first commit
This commit is contained in:
@@ -0,0 +1,311 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/GajiController
|
||||
Description : Transaksi Perhitungan Gaji
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 17th, 2014.
|
||||
Last Modified : September 13th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELGajiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butTambah').click(() => this.tx_tambah());
|
||||
$('#butUbah').click(() => this.tx_ubah());
|
||||
$('#butHapus').click(() => this.tx_hapus());
|
||||
$('#butSimpan').click(() => this.tx_simpan());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
$('#butPrint').click(() => this.tx_print());
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" 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="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-tx')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
});
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
});
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#No_Gaji').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#No_Gaji').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Gaji').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#No_Gaji').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Gaji').val()+'</strong> ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
new Request({
|
||||
url: this.PHP + '/proses_hapus',
|
||||
sendParam: ['No_Gaji'],
|
||||
onSuccess: (adata) => {
|
||||
if (adata.status==true){
|
||||
$('#No_Gaji').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}, this, 'DELETE '+$('#No_Gaji').val());
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Gaji').val('');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(){
|
||||
if (!$('#No_Gaji').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
this.winBCetak = FoniaJS.showWindow('BCetak', 'Daftar Pilihan Cetak Slip Gaji', '<div id="divBrowCetak"> </div>', 'lg', [{},{i:'butTutup'},{i:'butWCetak',v:'Cetak',c:'success'}], () => {
|
||||
$('#winBCetak').find('#butWCetak').click(() => this.tx_print_exec());
|
||||
this.data_query('brow-cetak');
|
||||
});
|
||||
},
|
||||
|
||||
tx_print_exec: function(){
|
||||
var cetak = new PrinterPos('report/nota/gaji');
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Gaji').val());
|
||||
cetak.exec();
|
||||
FoniaJS.closeWindow(this.winBCetak);
|
||||
},
|
||||
|
||||
karya_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Karya" 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="divBrowKarya"> </div>');
|
||||
this.winBKarya = FoniaJS.showWindow('BKarya', 'Daftar Karyawan', _isi, 'lg', '', () => {
|
||||
$('#winBKarya')
|
||||
.find('#Cari_Karya').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-karya');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-karya')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBKarya').find('#Cari_Karya').val('');
|
||||
this.data_query('brow-karya');
|
||||
});
|
||||
this.data_query('brow-karya');
|
||||
FoniaJS.setFocus('#Cari_Karya');
|
||||
});
|
||||
},
|
||||
|
||||
karya_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBKarya);
|
||||
this.detail_gaji('insert', 0, acell[0]);
|
||||
},
|
||||
|
||||
detail_gaji: function(mode, ID, KaryaID){
|
||||
new Request({
|
||||
url: this.PHP + '/form_gaji',
|
||||
sendParam: ['mode','mode_detail='+mode,'No_Gaji','ID='+ID,'KaryaID='+KaryaID],
|
||||
onSuccess: (a) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Gaji Karyawan', a.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
FoniaJS.AutoComplete('#Nama_Karya', this.PHP + '/auto_karya', ['No_Gaji'], {'selectFunc': this.Karya_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#Qty_Harian').keyup((e) => {
|
||||
this.Hitung_Detail();
|
||||
if (e.target.value == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Qty_Lembur');
|
||||
}).end()
|
||||
.find('#Qty_Lembur').keyup((e) => {
|
||||
this.Hitung_Detail();
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Qty_BonusM');
|
||||
}).end()
|
||||
.find('#Qty_BonusM').keyup((e) => {
|
||||
this.Hitung_Detail();
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Qty_BonusB');
|
||||
}).end()
|
||||
.find('#Qty_BonusB').keyup((e) => {
|
||||
this.Hitung_Detail();
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Total_Potong');
|
||||
}).end()
|
||||
.find('#Total_Potong').keyup((e) => {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) this.detail_simpan();
|
||||
});
|
||||
if (mode == 'insert' && KaryaID == 0) {
|
||||
FoniaJS.setFocus('#Nama_Karya');
|
||||
} else {
|
||||
this.Hitung_Detail();
|
||||
FoniaJS.setFocus('#Qty_Harian');
|
||||
}
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
this.detail_gaji('insert', 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_gaji('update', acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[2]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Gaji','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (parseInt($('#KaryaID').val())==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Karyawan !');
|
||||
return;
|
||||
}
|
||||
if (FoniaJS.StrToFloat($('#Total_Potong').val()) > FoniaJS.StrToFloat($('#Total_Pinjam').val())) {
|
||||
FoniaJS.showError('Jumlah Potongan melebihi Jumlah Pinjaman !');
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Gaji','KaryaID','Qty_Harian','Gaji_Harian','Qty_Lembur','Lembur_Harian','Qty_BonusM','Qty_BonusB','Bonus_Minggu','Bonus_Bulan','Total_Potong','CatatKar','ID'],
|
||||
onSuccess: () => {
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['mode='+mode,'No_Gaji'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['mode=save','No_Gaji','Tgl_Gaji','CabID','Tahun','Bulan','Minggu','Catatan='+encodeURIComponent($('#Catatan').val())];
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: sparam,
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#butBrow').click(() => this.tx_brow());
|
||||
$('#No_Gaji').keyup((e) => {
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Gaji")) && ($("#No_Gaji").val() !== '')) this.data_query('master');
|
||||
}
|
||||
});
|
||||
this.data_query('tabel-detail');
|
||||
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#butTambah').addClass('d-none');
|
||||
$('#butUbah').addClass('d-none');
|
||||
$('#butHapus').addClass('d-none');
|
||||
$('#butPrint').addClass('d-none');
|
||||
$('#butSimpan').removeClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#butTambah').removeClass('d-none');
|
||||
$('#butUbah').removeClass('d-none');
|
||||
$('#butHapus').removeClass('d-none');
|
||||
$('#butPrint').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Gaji']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-karya"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_karya',
|
||||
sendParam: ['No_Gaji','Cari_Karya'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Karya')
|
||||
}).send();
|
||||
} else if (tipe=="brow-cetak"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_cetak',
|
||||
sendParam: ['No_Gaji']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Karya_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#KaryaID').val(item.value);
|
||||
$('#Gaji_Harian').val(FoniaJS.FloatToStr(adata[0]));
|
||||
$('#Total_Pinjam').val(FoniaJS.FloatToStr(adata[1]));
|
||||
FoniaJS.setFocus('#Qty_Harian');
|
||||
},
|
||||
|
||||
oc_Minggu: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/option_minggu',
|
||||
sendParam: ['Tahun','Bulan'],
|
||||
onSuccess: (adata) => {
|
||||
if (!adata.option) return false;
|
||||
$('#Minggu').empty();
|
||||
adata.option.map((val) => {
|
||||
$('#Minggu').append(new Option(val['label'],val['value'],false))
|
||||
});
|
||||
$('#Minggu').trigger('change');
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
var dgaji = FoniaJS.StrToFloat($('#Qty_Harian').val()) * FoniaJS.StrToFloat($('#Gaji_Harian').val());
|
||||
var dlemb = FoniaJS.StrToFloat($('#Qty_Lembur').val()) * FoniaJS.StrToFloat($('#Lembur_Harian').val());
|
||||
var dbon1 = FoniaJS.StrToFloat($('#Qty_BonusM').val()) * FoniaJS.StrToFloat($('#Bonus_Minggu').val());
|
||||
var dbon2 = FoniaJS.StrToFloat($('#Qty_BonusB').val()) * FoniaJS.StrToFloat($('#Bonus_Bulan').val());
|
||||
var dpoto = FoniaJS.StrToFloat($('#Total_Potong').val());
|
||||
$('#Tot_Gaji').val(FoniaJS.FloatToStr(dgaji));
|
||||
$('#Tot_Lembur').val(FoniaJS.FloatToStr(dlemb));
|
||||
$('#Tot_Bonus1').val(FoniaJS.FloatToStr(dbon1));
|
||||
$('#Tot_Bonus2').val(FoniaJS.FloatToStr(dbon2));
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(dgaji+dlemb+dbon1+dbon2-dpoto));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,162 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/HutangController
|
||||
Description : Transaksi Pembayaran Hutang Supplier
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 7th, 2011.
|
||||
Last Modified : September 10th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELHutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butMode').click(() => this.tx_mode());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
if (FoniaJS.User.Level>0) $('#butMode').hide();
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_mode: function(){
|
||||
var mode = ($('#Mode_Tampil').val()==1) ? 0 : 1;
|
||||
$('#Mode_Tampil').val(mode);
|
||||
$('#butMode').html('<i class="bi-list me-2"></i>'+(mode==1?'Semua':'Normal'));
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
$('#divTXNota').removeClass('d-none');
|
||||
$('#divDetailNota').addClass('d-none');
|
||||
$('#divDetailBayar').addClass('d-none');
|
||||
if (FoniaJS.User.Level==0) $('#butMode').removeClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#Nama_Sup').prop('disabled', false).removeClass('disabled').addClass('enabled');
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
sup_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Sup" 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="divBrowSup"> </div>');
|
||||
this.winBSup = FoniaJS.showWindow('BSup', 'Daftar Supplier', _isi, 'xl', '', () => {
|
||||
$('#winBSup')
|
||||
.find('#Cari_Sup').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-sup');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-sup')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBSup').find('#Cari_Sup').val('');
|
||||
this.data_query('brow-sup');
|
||||
});
|
||||
this.data_query('brow-sup');
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
});
|
||||
},
|
||||
|
||||
sup_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBSup);
|
||||
$('#SupID').val(acell[0]);
|
||||
$('#Nama_Sup').val(acell[2]);
|
||||
$('#Alamat_Sup').val(acell[4]);
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
nota_select: function(acell){
|
||||
new Request({
|
||||
url: this.PHP + '/form_nota',
|
||||
sendParam: ['No_Beli='+acell[1],'Tipe_Nota='+acell[0]],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divDetailNota').html(ajson.html);
|
||||
$('#divTXNota').addClass('d-none');
|
||||
$('#divDetailNota').removeClass('d-none');
|
||||
$('#divDetailBayar').removeClass('d-none');
|
||||
if (FoniaJS.User.Level==0) $('#butMode').addClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#Nama_Sup').prop('disabled', true).removeClass('enabled').addClass('disabled');
|
||||
this.data_query('tabel-bayar');
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_show: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/form_bayar',
|
||||
sendParam: ['No_Beli','Total_Sisa'],
|
||||
onSuccess: (ajson) => {
|
||||
this.winBayar = FoniaJS.showWindow('Bayar', 'Detail Pembayaran', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBayar').find('#butWSimpan').click(() => this.bayar_simpan());
|
||||
FoniaJS.setFocus('#Total_Bayar');
|
||||
}, false);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['mode_detail=delete','No_Beli','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
bayar_simpan: function(){
|
||||
if ((FoniaJS.StrToFloat($('#Total_Bayar').val()) + FoniaJS.StrToFloat($('#Total_Potong').val())) > $('#Total_Sisa').val()){
|
||||
FoniaJS.showError("Jumlah pelunasan melebihi jumlah faktur!");
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['mode_detail=insert','SupID','No_Beli','Tgl_Bayar','Kode_Rek','Total_Bayar','Total_Potong','Tipe_Nota','Nama_Sup'],
|
||||
onSuccess: () => FoniaJS.closeWindow(this.winBayar)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: ['SupID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
this.tx_batal();
|
||||
FoniaJS.AutoComplete('#Nama_Sup', this.PHP + '/auto_sup', [], {'selectFunc': this.Sup_Comp});
|
||||
$('#Nama_Sup').click(() => $('#Nama_Sup').select());
|
||||
$('#butBrow').click(() => this.sup_brow());
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
}
|
||||
FoniaJS.setFocus('#Nama_Sup');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-nota"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_nota',
|
||||
sendParam: ['SupID','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="tabel-bayar"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['No_Beli','Lunas','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="brow-sup"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_sup',
|
||||
sendParam: ['Cari_Sup'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Sup')
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Sup_Comp: function(item){
|
||||
$('#SupID').val(item.value);
|
||||
$('#Alamat_Sup').val(item.data);
|
||||
GELHutangJS.data_query('tabel-nota');
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,105 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/KaryaController
|
||||
Description : Transaksi Pinjaman Karyawan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 9th, 2014.
|
||||
Last Modified : September 14th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELKaryaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butPinjam').click(() => this.tx_pinjam());
|
||||
$('#butBayar').click(() => this.tx_bayar());
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_pinjam: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/form_pinjam',
|
||||
sendParam: ['KaryaID'],
|
||||
onSuccess: (ajson) => {
|
||||
this.winPinjam = FoniaJS.showWindow('Pinjam', 'Detail Peminjaman', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winPinjam').find('#butWSimpan').click(() => this.pinjam_simpan());
|
||||
FoniaJS.setFocus('#Total_Pinjam');
|
||||
}, false);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
tx_bayar: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/form_bayar',
|
||||
sendParam: ['KaryaID'],
|
||||
onSuccess: (ajson) => {
|
||||
this.winBayar = FoniaJS.showWindow('Bayar', 'Detail Pembayaran', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBayar').find('#butWSimpan').click(() => this.bayar_simpan());
|
||||
FoniaJS.setFocus('#Total_Bayar');
|
||||
}, false);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
pinjam_simpan: function(){
|
||||
if (FoniaJS.StrToFloat($('#Total_Pinjam').val()) == 0){
|
||||
FoniaJS.showError("Silahkan masukkan jumlah pinjaman !");
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_karya',
|
||||
sendParam: ['mode_detail=insert','Tgl_Trans','Kode_Rek','Total_Pinjam','KaryaID','Nama_Karya='+$('#KaryaID').find(':selected').text(),'Catatan','is_pinjam=1'],
|
||||
onSuccess: () => FoniaJS.closeWindow(this.winPinjam)
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_simpan: function(){
|
||||
if (FoniaJS.StrToFloat($('#Total_Bayar').val()) == 0){
|
||||
FoniaJS.showError("Silahkan masukkan jumlah pembayaran !");
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_karya',
|
||||
sendParam: ['mode_detail=insert','Tgl_Trans','Kode_Rek','Total_Bayar','KaryaID','Nama_Karya='+$('#KaryaID').find(':selected').text(),'Catatan','is_pinjam=0'],
|
||||
onSuccess: () => FoniaJS.closeWindow(this.winBayar)
|
||||
}).send();
|
||||
},
|
||||
|
||||
karya_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[0]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_karya',
|
||||
sendParam: ['mode_detail=delete','KaryaID','No_Trans='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: ['KaryaID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#KaryaID').focus();
|
||||
this.data_query('tabel-karya');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-karya"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_karya',
|
||||
sendParam: ['KaryaID']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
ocKarya: function() {
|
||||
this.data_query('master');
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,261 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/KeluarController
|
||||
Description : Jurnal Pengeluaran Kas / Bank
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : September 10th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELKeluarJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butTambah').click(() => this.tx_tambah());
|
||||
$('#butUbah').click(() => this.tx_ubah());
|
||||
$('#butHapus').click(() => this.tx_hapus());
|
||||
$('#butSimpan').click(() => this.tx_simpan());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" 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="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-tx')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
});
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
});
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#Kode_Jurnal').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#Kode_Jurnal').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#Kode_Jurnal').val()+'</strong> ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
new Request({
|
||||
url: this.PHP + '/proses_hapus',
|
||||
sendParam: ['Kode_Jurnal'],
|
||||
onSuccess: (adata) => {
|
||||
if (adata.status==true){
|
||||
$('#Kode_Jurnal').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}, this, 'DELETE '+$('#Kode_Jurnal').val());
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
if ($('#Total_Item').val()==0){
|
||||
FoniaJS.showError("Belum ada Item Jurnal!");
|
||||
return false;
|
||||
}
|
||||
if (!this.cek_awal()) return false;
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#Kode_Jurnal').val('');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
cek_awal: function(){
|
||||
/*if (GEL_Kunci($('Tanggal').get('value'))) {
|
||||
FoniaJS.showErrorLocale('SHIAS.lock_periode', 2000);
|
||||
return false;
|
||||
}*/
|
||||
if ($('#Kode_Ref').val()==''){
|
||||
FoniaJS.showError("Silakan masukkan Kode Referensi!");
|
||||
FoniaJS.setFocus("#Kode_Ref");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
rek_brow: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Rek" 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="divBrowRek"> </div>');
|
||||
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');
|
||||
FoniaJS.setFocus('#Cari_Rek');
|
||||
});
|
||||
},
|
||||
|
||||
rek_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBRek);
|
||||
this.detail_rek('insert', 0, acell[0]);
|
||||
},
|
||||
|
||||
detail_rek: function(mode, ID, Kode_Rek){
|
||||
new Request({
|
||||
url: this.PHP + '/form_rek',
|
||||
sendParam: ['mode','mode_detail='+mode,'Kode_Jurnal','ID='+ID,'Kode_Rek='+Kode_Rek],
|
||||
onSuccess: (a) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jurnal', a.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
FoniaJS.AutoComplete('#Nama_Rek', this.PHP + '/auto_rek', ['Kode_Jurnal'], {'selectFunc': this.Rek_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#Jumlah').keyup((e) => {
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
});
|
||||
if (mode == 'insert' && Kode_Rek == 0) {
|
||||
FoniaJS.setFocus('#Nama_Rek');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
this.detail_rek('insert', 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_rek('update', acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+' - '+acell[2]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','Kode_Jurnal','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (parseInt($('#Kode_Rek').val())==0) {
|
||||
FoniaJS.showError('Silakan masukkan Rekening Jurnal !');
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','Kode_Jurnal','Kode_Rek','Jumlah','ID'],
|
||||
onSuccess: () => {
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['mode='+mode,'Kode_Jurnal'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['mode=save','Kode_Jurnal','Tanggal','CabID','Kode_Ref','Kode_Kas','Catatan='+encodeURIComponent($('#Catatan').val())];
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: sparam,
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#butBrow').click(() => this.tx_brow());
|
||||
$('#Kode_Jurnal').keyup((e) => {
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#Kode_Jurnal")) && ($("#Kode_Jurnal").val() !== '')) this.data_query('master');
|
||||
}
|
||||
});
|
||||
this.data_query('tabel-detail');
|
||||
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#butTambah').addClass('d-none');
|
||||
$('#butUbah').addClass('d-none');
|
||||
$('#butHapus').addClass('d-none');
|
||||
$('#butSimpan').removeClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
FoniaJS.setFocus('#Kode_Ref');
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#butTambah').removeClass('d-none');
|
||||
$('#butUbah').removeClass('d-none');
|
||||
$('#butHapus').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#Kode_Jurnal');
|
||||
}
|
||||
/*if (GEL_Kunci($('Tanggal').val())) {
|
||||
$("butEdit").disabled = true;
|
||||
$("butDel").disabled = true;
|
||||
}*/
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','Kode_Jurnal']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-rek"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_rek',
|
||||
sendParam: ['Cari_Rek'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Rek')
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Rek_Comp: function(item){
|
||||
$('#Kode_Rek').val(item.value);
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,162 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/PiutangController
|
||||
Description : Transaksi Penerimaan Piutang Buyer / Member
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 7th, 2011.
|
||||
Last Modified : September 13th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELPiutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butMode').click(() => this.tx_mode());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
if (FoniaJS.User.Level>0) $('#butMode').hide();
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_mode: function(){
|
||||
var mode = ($('#Mode_Tampil').val()==1) ? 0 : 1;
|
||||
$('#Mode_Tampil').val(mode);
|
||||
$('#butMode').html('<i class="bi-list me-2"></i>'+(mode==1?'Semua':'Normal'));
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
$('#divTXNota').removeClass('d-none');
|
||||
$('#divDetailNota').addClass('d-none');
|
||||
$('#divDetailBayar').addClass('d-none');
|
||||
if (FoniaJS.User.Level==0) $('#butMode').removeClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#Nama_Member').prop('disabled', false).removeClass('disabled').addClass('enabled');
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
buyer_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Buyer" 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="divBrowBuyer"> </div>');
|
||||
this.winBBuyer = FoniaJS.showWindow('BBuyer', 'Daftar Member', _isi, 'xl', '', () => {
|
||||
$('#winBBuyer')
|
||||
.find('#Cari_Buyer').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-buyer');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-buyer')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBBuyer').find('#Cari_Buyer').val('');
|
||||
this.data_query('brow-buyer');
|
||||
});
|
||||
this.data_query('brow-buyer');
|
||||
FoniaJS.setFocus('#Cari_Buyer');
|
||||
});
|
||||
},
|
||||
|
||||
buyer_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBBuyer);
|
||||
$('#MemberID').val(acell[0]);
|
||||
$('#Nama_Member').val(acell[2]);
|
||||
$('#Alamat_Member').val(acell[3]);
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
nota_select: function(acell){
|
||||
new Request({
|
||||
url: this.PHP + '/form_nota',
|
||||
sendParam: ['No_Jual='+acell[1],'Tipe_Nota='+acell[0]],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divDetailNota').html(ajson.html);
|
||||
$('#divTXNota').addClass('d-none');
|
||||
$('#divDetailNota').removeClass('d-none');
|
||||
$('#divDetailBayar').removeClass('d-none');
|
||||
if (FoniaJS.User.Level==0) $('#butMode').addClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#Nama_Member').prop('disabled', true).removeClass('enabled').addClass('disabled');
|
||||
this.data_query('tabel-bayar');
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_show: function(){
|
||||
new Request({
|
||||
url: this.PHP + '/form_bayar',
|
||||
sendParam: ['No_Jual','Total_Sisa'],
|
||||
onSuccess: (ajson) => {
|
||||
this.winBayar = FoniaJS.showWindow('Bayar', 'Detail Pembayaran', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBayar').find('#butWSimpan').click(() => this.bayar_simpan());
|
||||
FoniaJS.setFocus('#Total_Bayar');
|
||||
}, false);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['mode_detail=delete','No_Jual','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
bayar_simpan: function(){
|
||||
if ((FoniaJS.StrToFloat($('#Total_Bayar').val()) + FoniaJS.StrToFloat($('#Total_Potong').val())) > $('#Total_Sisa').val()){
|
||||
FoniaJS.showError("Jumlah pelunasan melebihi jumlah faktur!");
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['mode_detail=insert','MemberID','No_Jual','Tgl_Bayar','Kode_Rek','Total_Bayar','Total_Potong','Tipe_Nota','Nama_Member'],
|
||||
onSuccess: () => FoniaJS.closeWindow(this.winBayar)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: ['MemberID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')],
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
this.tx_batal();
|
||||
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_sup', [], {'selectFunc': this.Member_Comp});
|
||||
$('#Nama_Member').click(() => $('#Nama_Member').select());
|
||||
$('#butBrow').click(() => this.buyer_brow());
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
}
|
||||
FoniaJS.setFocus('#Nama_Member');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-nota"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_nota',
|
||||
sendParam: ['MemberID','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="tabel-bayar"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
sendParam: ['No_Jual','Lunas','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="brow-buyer"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_buyer',
|
||||
sendParam: ['Cari_Buyer'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Buyer')
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Member_Comp: function(item){
|
||||
$('#MemberID').val(item.value);
|
||||
$('#Alamat_Member').val(item.data);
|
||||
GELPiutangJS.data_query('tabel-nota');
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,261 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/TerimaController
|
||||
Description : Jurnal Penerimaan Kas / Bank
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : September 9th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELTerimaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butTambah').click(() => this.tx_tambah());
|
||||
$('#butUbah').click(() => this.tx_ubah());
|
||||
$('#butHapus').click(() => this.tx_hapus());
|
||||
$('#butSimpan').click(() => this.tx_simpan());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" 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="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-tx')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
});
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
});
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#Kode_Jurnal').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#Kode_Jurnal').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#Kode_Jurnal').val()+'</strong> ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
new Request({
|
||||
url: this.PHP + '/proses_hapus',
|
||||
sendParam: ['Kode_Jurnal'],
|
||||
onSuccess: (adata) => {
|
||||
if (adata.status==true){
|
||||
$('#Kode_Jurnal').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}, this, 'DELETE '+$('#Kode_Jurnal').val());
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
if ($('#Total_Item').val()==0){
|
||||
FoniaJS.showError("Belum ada Item Jurnal!");
|
||||
return false;
|
||||
}
|
||||
if (!this.cek_awal()) return false;
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#Kode_Jurnal').val('');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
cek_awal: function(){
|
||||
/*if (GEL_Kunci($('Tanggal').get('value'))) {
|
||||
FoniaJS.showErrorLocale('SHIAS.lock_periode', 2000);
|
||||
return false;
|
||||
}*/
|
||||
if ($('#Kode_Ref').val()==''){
|
||||
FoniaJS.showError("Silakan masukkan Kode Referensi!");
|
||||
FoniaJS.setFocus("#Kode_Ref");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
rek_brow: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Rek" 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="divBrowRek"> </div>');
|
||||
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');
|
||||
FoniaJS.setFocus('#Cari_Rek');
|
||||
});
|
||||
},
|
||||
|
||||
rek_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBRek);
|
||||
this.detail_rek('insert', 0, acell[0]);
|
||||
},
|
||||
|
||||
detail_rek: function(mode, ID, Kode_Rek){
|
||||
new Request({
|
||||
url: this.PHP + '/form_rek',
|
||||
sendParam: ['mode','mode_detail='+mode,'Kode_Jurnal','ID='+ID,'Kode_Rek='+Kode_Rek],
|
||||
onSuccess: (a) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jurnal', a.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
FoniaJS.AutoComplete('#Nama_Rek', this.PHP + '/auto_rek', ['Kode_Jurnal'], {'selectFunc': this.Rek_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#Jumlah').keyup((e) => {
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
});
|
||||
if (mode == 'insert' && Kode_Rek == 0) {
|
||||
FoniaJS.setFocus('#Nama_Rek');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
this.detail_rek('insert', 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_rek('update', acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+' - '+acell[2]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','Kode_Jurnal','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (parseInt($('#Kode_Rek').val())==0) {
|
||||
FoniaJS.showError('Silakan masukkan Rekening Jurnal !');
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','Kode_Jurnal','Kode_Rek','Jumlah','ID'],
|
||||
onSuccess: () => {
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['mode='+mode,'Kode_Jurnal'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['mode=save','Kode_Jurnal','Tanggal','CabID','Kode_Ref','Kode_Kas','Catatan='+encodeURIComponent($('#Catatan').val())];
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: sparam,
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#butBrow').click(() => this.tx_brow());
|
||||
$('#Kode_Jurnal').keyup((e) => {
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#Kode_Jurnal")) && ($("#Kode_Jurnal").val() !== '')) this.data_query('master');
|
||||
}
|
||||
});
|
||||
this.data_query('tabel-detail');
|
||||
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#butTambah').addClass('d-none');
|
||||
$('#butUbah').addClass('d-none');
|
||||
$('#butHapus').addClass('d-none');
|
||||
$('#butSimpan').removeClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
FoniaJS.setFocus('#Kode_Ref');
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#butTambah').removeClass('d-none');
|
||||
$('#butUbah').removeClass('d-none');
|
||||
$('#butHapus').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#Kode_Jurnal');
|
||||
}
|
||||
/*if (GEL_Kunci($('Tanggal').get('value'))) {
|
||||
$("butEdit").disabled = true;
|
||||
$("butDel").disabled = true;
|
||||
}*/
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','Kode_Jurnal']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-rek"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_rek',
|
||||
sendParam: ['Cari_Rek'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Rek')
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Rek_Comp: function(item){
|
||||
$('#Kode_Rek').val(item.value);
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,264 @@
|
||||
/*******************************************************************
|
||||
|
||||
PHP Class : /Controller/Gel/UmumController
|
||||
Description : Jurnal Umum
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : September 10th, 2026.
|
||||
|
||||
(c) 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var GELUmumJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
$('#butTambah').click(() => this.tx_tambah());
|
||||
$('#butUbah').click(() => this.tx_ubah());$('#butHapus').click(() => this.tx_hapus());
|
||||
$('#butSimpan').click(() => this.tx_simpan());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" 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="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}).end()
|
||||
.find('#butSearch').click(() => this.data_query('brow-tx')).end()
|
||||
.find('#butAll').click(() => {
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
});
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
});
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#Kode_Jurnal').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#Kode_Jurnal').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#Kode_Jurnal').val()){
|
||||
FoniaJS.showError("Silakan masukkan Kode Jurnal !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#Kode_Jurnal').val()+'</strong> ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
new Request({
|
||||
url: this.PHP + '/proses_hapus',
|
||||
sendParam: ['Kode_Jurnal'],
|
||||
onSuccess: (adata) => {
|
||||
if (adata.status==true){
|
||||
$('#Kode_Jurnal').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}, this, 'DELETE '+$('#Kode_Jurnal').val());
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
if ($('#Total_Item').val()==0){
|
||||
FoniaJS.showError("Belum ada Item Jurnal!");
|
||||
return false;
|
||||
}
|
||||
if ($('#Total_Jumlah').val()!=0){
|
||||
FoniaJS.showError("Jurnal Debit dan Kredit belum seimbang!");
|
||||
return false;
|
||||
}
|
||||
if (!this.cek_awal()) return false;
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#Kode_Jurnal').val('');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
cek_awal: function(){
|
||||
/*if (GEL_Kunci($('Tanggal').get('value'))) {
|
||||
FoniaJS.showErrorLocale('SHIAS.lock_periode', 2000);
|
||||
return false;
|
||||
}*/
|
||||
if ($('#Kode_Ref').val()==''){
|
||||
FoniaJS.showError("Silakan masukkan Kode Referensi!");
|
||||
FoniaJS.setFocus("#Kode_Ref");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
rek_brow: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Rek" 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="divBrowRek"> </div>');
|
||||
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');
|
||||
FoniaJS.setFocus('#Cari_Rek');
|
||||
});
|
||||
},
|
||||
|
||||
rek_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBRek);
|
||||
this.detail_rek('insert', 0, acell[0], 'D');
|
||||
},
|
||||
|
||||
detail_rek: function(mode, ID, Kode_Rek, DK){
|
||||
new Request({
|
||||
url: this.PHP + '/form_rek',
|
||||
sendParam: ['mode','mode_detail='+mode,'Kode_Jurnal','ID='+ID,'Kode_Rek='+Kode_Rek,'DK='+DK],
|
||||
onSuccess: (a) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jurnal', a.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
|
||||
FoniaJS.AutoComplete('#Nama_Rek', this.PHP + '/auto_rek', ['Kode_Jurnal'], {'selectFunc': this.Rek_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#Jumlah').keyup((e) => {
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
});
|
||||
if (mode == 'insert' && Kode_Rek == 0) {
|
||||
FoniaJS.setFocus('#Nama_Rek');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if (!this.cek_awal()) return false;
|
||||
this.detail_rek('insert', 0, 0, 'D');
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_rek('update', acell[0], acell[1], acell[3]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+' - '+acell[2]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','Kode_Jurnal','ID='+acell[0]]
|
||||
}).send();
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
if (parseInt($('#Kode_Rek').val())==0) {
|
||||
FoniaJS.showError('Silakan masukkan Rekening Jurnal !');
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','Kode_Jurnal','Kode_Rek','DK','Jumlah','ID'],
|
||||
onSuccess: () => {
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['mode='+mode,'Kode_Jurnal'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['mode=save','Kode_Jurnal','Tanggal','CabID','Kode_Ref','Catatan='+encodeURIComponent($('#Catatan').val())];
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
sendParam: sparam,
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#butBrow').click(() => this.tx_brow());
|
||||
$('#Kode_Jurnal').keyup((e) => {
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#Kode_Jurnal")) && ($("#Kode_Jurnal").val() !== '')) this.data_query('master');
|
||||
}
|
||||
});
|
||||
this.data_query('tabel-detail');
|
||||
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
|
||||
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
|
||||
$('#butTambah').addClass('d-none');
|
||||
$('#butUbah').addClass('d-none');
|
||||
$('#butHapus').addClass('d-none');
|
||||
$('#butSimpan').removeClass('d-none');
|
||||
$('#butBatal').removeClass('d-none');
|
||||
FoniaJS.setFocus('#Kode_Ref');
|
||||
} else {
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#butTambah').removeClass('d-none');
|
||||
$('#butUbah').removeClass('d-none');
|
||||
$('#butHapus').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#Kode_Jurnal');
|
||||
}
|
||||
/*if (GEL_Kunci($('Tanggal').val())) {
|
||||
$("butEdit").disabled = true;
|
||||
$("butDel").disabled = true;
|
||||
}*/
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','Kode_Jurnal']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-rek"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP + '/brow_rek',
|
||||
sendParam: ['Cari_Rek'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Rek')
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Rek_Comp: function(item){
|
||||
$('#Kode_Rek').val(item.value);
|
||||
FoniaJS.setFocus('#Jumlah');
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user