first commit

This commit is contained in:
2026-10-29 13:34:31 +07:00
commit 45e4595c57
255 changed files with 35457 additions and 0 deletions
+87
View File
@@ -0,0 +1,87 @@
/*******************************************************************
PHP Class : /Controller/Display/ConfigController
Description : Konfigurasi Display POS
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPConfigJS = {
PHP: '',
KODE: '',
index: function(){
$('#butBrow').click(() => this.cab_brow());
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('form-display');
},
cab_brow: function(){
var _isi = new String('<div id="divBrowCab">&nbsp;</div>');
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', () => this.data_query('brow-cabang'));
},
cab_select: function(acell){
FoniaJS.closeWindow(this.winBCab);
$('#REG_ID').val(acell[0]);
this.data_query('form-display', 'view');
},
proses_edit: function(){
this.data_query('form-display', 'edit');
this.load_port();
},
proses_save: function(){
this.data_query('form-display', 'save');
},
data_query: function(tipe, mode){
if (tipe=='form-display'){
new Request({
url: this.PHP + '/form_display',
sendParam: ['mode='+mode,'REG_ID','MON_ENABLE','Text_Run','Warna','Font','Promo_Idle','Promo_Durasi','POLE_ENABLE','POLE_PORT','POLE_START1','POLE_START2','POLE_END1','POLE_END2'],
onSuccess: (ajson) => {
$('#divDisplay').html(ajson.html);
$('#Nama_Cabang').val(ajson.Nama_Cab);
this.update_event();
if (ajson.sukses) FoniaJS.showInfo('Konfigurasi display POS sukses disimpan!');
}
}).send();
} else if (tipe=='brow-cabang'){
new Request.JSONF({
url: this.PHP + '/brow_cabang',
}).send();
}
},
update_event: function(){
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
$('#butBrow').prop('disabled', true);
$('#butUbah').prop('disabled', true);
$('#butSimpan').prop('disabled', false);
} else {
$('#butBrow').prop('disabled', false);
$('#butUbah').prop('disabled', false);
$('#butSimpan').prop('disabled', true);
}
},
load_port: function(){
var parent = this;
qz.serial.findPorts().then(function(data){
var _selport = $('#POLE_PORT').val();
$('#POLE_PORT').empty();
for (var i = 0; i < data.length; i++){
$('<option/>', {value: data[i]}).text(data[i]).appendTo('#POLE_PORT');
};
$('#POLE_PORT').val(_selport);
});
}
};
+114
View File
@@ -0,0 +1,114 @@
/*******************************************************************
PHP Class : /Controller/Display/IklanController
Description : Konfigurasi Display Iklan POS
Created By : Siau Pheng ([email protected]).
Created Date : January 15th, 2015.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPIklanJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Iklan').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Iklan').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Iklan');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_iklan',
sendParam: ['mode_detail='+mode,'PromoID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Iklan', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_save()).end()
.find('#FileGambar').off('change').change(() => {
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
fd.append('PromoID', $('#PromoID').val());
$.ajax({
url: this.PHP + '/upload_picture',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: (ares) => {
if (ares.result != 0){
FoniaJS.showInfo('Sukses upload file Gambar !');
$('#PromoID').val(ares.PromoID);
this.get_picture();
} else {
FoniaJS.showError(ares.message);
}
}
});
});
this.get_picture();
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Iklan'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','PromoID','CabID','Tanggal','Info','Aktif','Cari_Iklan'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Iklan']
}).send();
}
},
get_picture: function(){
new Request({
url: this.PHP + '/get_picture',
sendParam: ['PromoID'],
onSuccess: (ajson) => {
$('#imgPhoto').attr('src', ajson.src);
}
}).send();
}
};
+114
View File
@@ -0,0 +1,114 @@
/*******************************************************************
PHP Class : /Controller/Display/PromoController
Description : Konfigurasi Display Promo POS
Created By : Siau Pheng ([email protected]).
Created Date : January 15th, 2015.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var DISPPromoJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Promo').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Promo').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Promo');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_promo',
sendParam: ['mode_detail='+mode,'PromoID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Promo', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_save()).end()
.find('#FileGambar').off('change').change(() => {
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
fd.append('PromoID', $('#PromoID').val());
$.ajax({
url: this.PHP + '/upload_picture',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: (ares) => {
if (ares.result != 0){
FoniaJS.showInfo('Sukses upload file Gambar !');
$('#PromoID').val(ares.PromoID);
this.get_picture();
} else {
FoniaJS.showError(ares.message);
}
}
});
});
this.get_picture();
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','PromoID','Tanggal','Info','Warna','Font','Aktif','Cari_Promo'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Promo']
}).send();
}
},
get_picture: function(){
new Request({
url: this.PHP + '/get_picture',
sendParam: ['PromoID'],
onSuccess: (ajson) => {
$('#imgPhoto').attr('src', ajson.src);
}
}).send();
}
};
+311
View File
@@ -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">&nbsp;</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">&nbsp;</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">&nbsp;</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));
}
};
+162
View File
@@ -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">&nbsp;</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');
}
};
+105
View File
@@ -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');
}
};
+261
View File
@@ -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">&nbsp;</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">&nbsp;</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');
}
};
+162
View File
@@ -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">&nbsp;</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');
}
};
+261
View File
@@ -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">&nbsp;</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">&nbsp;</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');
}
};
+264
View File
@@ -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">&nbsp;</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">&nbsp;</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');
}
};
+148
View File
@@ -0,0 +1,148 @@
/*******************************************************************
PHP Class : /Controller/IndexController
Description : Halaman Utama Aplikasi / Index
Created By : Siau Pheng ([email protected]).
Created Date : May 24th, 2010.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
$(document).ready(() => {
$("#preloader").remove();
loadSidebar();
IndexJS.index();
if (window.Desktop_Chart) clearInterval(window.Desktop_Chart);
window.Desktop_Chart = setInterval(() => {
if ($('#ChartB').length == 0) return false;
IndexJS.load_chart();
}, 600000);
// QZ Printer
$('#qzLaunch').click(() => launchQZ());
$('#qzStart').click(() => startConnection());
$('#qzStop').click(() => endConnection());
if ('undefined' !== typeof qz) startConnection();
});
var socket = io(window.location.host, { 'path': '/io' });
// PPOB
socket.on('ppob-data', (adata) => {
//console.log('reply ppob-data', adata);
if (Array.isArray(adata.prabayar) && adata.prabayar.length > 0){
$.each(adata.prabayar, (i, v) => {
if (v.Status == 4) PrabayarJS.proses_print(0, v.No_TX);
});
socket.emit('ppob-update', { 'UserID': FoniaJS.User.UID, 'CabID': FoniaJS.User.CabID });
} else socket.emit('ppob-done');
});
// SUPERVISI
socket.on('super-data', (adata) => {
//console.log('reply super-data', adata);
if ($('#divSuper').length === 0) socket.emit('super-done');
if (Array.isArray(adata.data)) {
var table = $('#divSuperTabel').DataTable();
table.clear();
table.rows.add(adata.data).draw();
}
});
var IndexJS = {
index: function(){
new Request({
url: 'index/index',
sendParam: [],
onSuccess: (ares) => {
$('#pageContent').html(ares.html);
$('#pageToolbarTop').html('');
$('#pageToolbarBot').html('');
FoniaJS.User.CabID = +ares.CabID || 0;
if (socket.active) socket.emit('ppob-check', { 'UserID': FoniaJS.User.UID, 'CabID': FoniaJS.User.CabID });
this.get_picture();
this.load_chart();
}
}).send();
},
get_picture: function(){
new Request({
url: 'system/profile/get_picture',
onSuccess: (ajson) => {
$('img.get-picture').attr('src', ajson.src);
}
}).send();
},
load_chart: function(){
this.data_query('chart-sale');
this.data_query('chart-omzet');
this.data_query('tabel-stok');
},
data_query: function(tipe){
if (tipe=="chart-sale"){
new Request({
url: 'index/chart_sale',
onSuccess: (ares) => {
if (ares.tipe=='chart') {
var ctx = Chart.getChart('ChartA');
if (typeof ctx !== 'undefined') ctx.destroy();
var myChart = new Chart($('#ChartA'), {
type: ares.chart.type,
data: ares.chart.data,
options: ares.chart.options
});
}
}
}).send();
} else if (tipe=="chart-omzet"){
new Request({
url: 'index/chart_omzet',
onSuccess: (ares) => {
if (ares.tipe=='chart') {
var ctx = Chart.getChart('ChartB');
if (typeof ctx !== 'undefined') ctx.destroy();
var myChart = new Chart($('#ChartB'), {
type: ares.chart.type,
data: ares.chart.data,
options: ares.chart.options
});
}
}
}).send();
} else if (tipe=="tabel-stok"){
new Request({
url: 'index/table_stok',
onSuccess: (ares) => {
if (ares.tipe=='tabel') {
$('#tabelStok').html(ares.html);
}
}
}).send();
}
}
};
function loadSidebar(){
const mySidebar = document.getElementById('sidebarMain');
mySidebar.addEventListener('shown.bs.modal', () => {
document.querySelectorAll('.sidebar .nav-link').forEach((element) => {
element.addEventListener('click', (e) => {
let nextEl = element.nextElementSibling, parentEl = element.parentElement;
if (nextEl){
e.preventDefault();
let mycollapse = new bootstrap.Collapse(nextEl);
if (nextEl.classList.contains('show')){
mycollapse.hide();
} else {
mycollapse.show();
var opened_submenu = parentEl.parentElement.querySelector('.submenu.show');
if (opened_submenu){ new bootstrap.Collapse(opened_submenu); }
}
}
});
})
});
}
+444
View File
@@ -0,0 +1,444 @@
/*******************************************************************
PHP Class : /Controller/Inv/BeliController
Description : Transaksi Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : May 22th, 2010.
Last Modified : September 20th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var BeliJS = {
PHP: '',
KODE: '',
index: function(q){
$('#butTambah').click(() => this.tx_tambah());
$('#butUbah').click(() => this.tx_ubah());
$('#butHapus').click(() => this.tx_hapus());
$('#butPendingBrow').click(() => this.pending_brow());
$('#butPendingSimpan').click(() => this.tx_simpan('pending'));
$('#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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_Beli').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
if (-1 !== $('#No_Beli').val().search(/BELI/i)){
this.data_query('master', 'pending-edit')
return;
}
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Beli').val());
},
tx_hapus: function(){
if (!$('#No_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Beli').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_Beli'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_Beli').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_Beli').val());
}, 'danger');
},
tx_simpan: function(mode){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
}
if (mode == 'pending'){
this.data_query('master', 'pending-save');
return;
}
if (parseFloat($('#Real_Beli').val())==0){
this.total_show();
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Beli').val('');
}, 'danger');
},
tx_print: function(prt){
if ($('#No_Beli').val()) {
var cetak = new Printer('report/nota/beli');
cetak.add_param("Nomor_Cetak", $('#No_Beli').val());
if (prt) cetak.doPrint(); else cetak.doPreview();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
pending_brow: function(){
var _isi = new String('<div id="divBrowPending">&nbsp;</div>');
this.winBPending = FoniaJS.showWindow('BPending', 'Daftar Pending Pembelian', _isi, 'xl', '', () => this.data_query('brow-pending'));
},
pending_select: function(acell){
FoniaJS.closeWindow(this.winBPending);
$('#No_Beli').val(acell[0]);
this.data_query('master', 'pending-edit');
},
pending_delete: function(acell){
FoniaJS.closeWindow(this.winBPending);
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Transaksi Pending "'+acell[0]+'" ?', () => {
$('#No_Beli').val(acell[0]);
this.data_query('master', 'pending-delete');
}, 'danger');
},
produk_brow: function(){
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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><input type="hidden" id="Filter_Browse" value="all" /></div></div></div><div id="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
if ($('#Filter_Browse').val()=='filter') {
$('#Filter_Browse').val('all');
$('#butAll').html('Semua');
} else {
$('#Filter_Browse').val('filter');
$('#butAll').html('Supplier');
}
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'No_Beli','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Beli','CabID','SupID'], {'selectFunc':this.Produk_Comp});
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#Nama_Produk').click(() => $('#Nama_Produk').select()).end()
.find('#Qty').keyup((e) => {
this.Hitung_Detail();
if (e.which==13 && parseInt(e.target.value)>0) FoniaJS.setFocus('#Harga_Beli');
}).end()
.find('#Harga_Beli').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Rupiah');
}).end()
.find('#Disk_Rupiah').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Persen1');
}).end()
.find('#Disk_Persen1').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Persen2');
}).end()
.find('#Disk_Persen2').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Persen3');
}).end()
.find('#Disk_Persen3').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Persen4');
}).end()
.find('#Disk_Persen4').keyup((e) => {
this.Hitung_Detail();
if (e.which==13) FoniaJS.setFocus('#Disk_Persen5');
}).end()
.find('#Disk_Persen5').keyup((e) => {
this.Hitung_Detail();
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
});
if ($('#mode_detail').val() == 'insert') {
if ($('#InvID').val() == 0) {
FoniaJS.setFocus('#Nama_Produk');
} else {
this.update_Items();
}
} else {
this.Hitung_Detail();
this.update_Varian();
FoniaJS.setFocus('#Qty');
}
}, false);
}
}).send();
},
detail_tambah: function(){
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
}
this.detail_produk('insert', 0, 0, 0, 0);
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail=delete','No_Beli','ID='+acell[0]],
onSuccess: () => {
var _obtn = $('button:contains("Total")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-secondary').attr('id','tombolTotal').html('Hutang : '+FoniaJS.FloatToStr($('#Real_Beli').val(),2));
}
}).send();
}, 'danger');
},
detail_simpan: function(){
if (parseInt($('#InvID').val())==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
return;
}
var _mdetail = $('#mode_detail').val();
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','No_Beli','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Disk_Rupiah','Disk_Persen1','Disk_Persen2','Disk_Persen3','Disk_Persen4','Disk_Persen5'],
onSuccess: () => {
var _obtn = $('button:contains("Total")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-secondary').attr('id','tombolTotal').html('Hutang : '+FoniaJS.FloatToStr($('#Real_Beli').val(),2));
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
total_show: function(){
if (['add','edit'].indexOf($('#mode').val()) == -1) return false;
new Request({
url: this.PHP + '/form_total',
onSuccess: (ajson) => {
this.winTotal = FoniaJS.showWindow('Total', 'Informasi Transaksi', ajson.html, 'md', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
var dhutang = parseFloat($('#Real_Beli').val());
if (dhutang == 0) dhutang = parseFloat($('#Total_Beli').val());
$('#winTotal')
.find('#butWSimpan').click(() => this.total_simpan()).end()
.find('#popTotal_Diskon').keyup((e) => {
if (e.which==13) FoniaJS.setFocus('#popTotal_Beli');
}).end()
.find('#popTotal_Beli').keyup((e) => {
if (e.which==13) $('#butWSimpan').focus();
}).end()
.find('#popTotal_Diskon').val($('#Real_Diskon').val()).end()
.find('#popTotal_Beli').val(dhutang);
FoniaJS.setFocus('#popTotal_Diskon');
}, false);
}
}).send();
},
total_simpan: function(){
$('#Real_Diskon').val(FoniaJS.StrToFloat($('#popTotal_Diskon').val()));
$('#Real_Beli').val(FoniaJS.StrToFloat($('#popTotal_Beli').val()));
$('#tombolTotal').html('<i class="bi-wallet2 me-1"></i>Hutang : '+FoniaJS.FloatToStr($('#Real_Beli').val(),2));
FoniaJS.closeWindow(this.winTotal);
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="master"){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_Beli'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'No_Beli','Tgl_Beli','Tgl_Faktur','No_Faktur','CabID','SupID','Real_Diskon','Real_Beli','PPN'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
$('#No_Beli').keyup((e) =>{
if ((e.which || e.keyCode) == 13) {
if (($("#No_Beli")) && ($("#No_Beli").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
$('#No_Faktur').addClass('w-auto');
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');
$('#butPendingBrow').addClass('d-none');
$('#butPendingSimpan').addClass('d-none');
if (-1 !== $('#No_Beli').val().search(/BELI/i)) $('#butPendingSimpan').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');
$('#butPendingBrow').removeClass('d-none');
$('#butPendingSimpan').addClass('d-none');
}
$('#butUbah').prop('disabled', ($('#Lunas').val()==1 ? true : false));
$('#butHapus').prop('disabled', ($('#Lunas').val()==1 ? true : false));
if (ajson.error) {
FoniaJS.showError(ajson.error);
FoniaJS.setFocus('#No_Beli');
}
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','No_Beli'],
onSuccess: () => {
var _obtn = $('button:contains("Total")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-secondary').attr('id','tombolTotal').html('<i class="bi-wallet2 me-1"></i>Hutang : '+FoniaJS.FloatToStr($('#Real_Beli').val(),2));
}
}).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-pending"){
new Request.JSONF({
url: this.PHP + '/brow_pending',
sendParam: ['Cari_Pending']
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk','Filter_Browse','SupID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
$('#Nama_Satuan').val(adata[2]);
var _vari = $('#VarianID');
_vari.append($('<option>', { value: adata[1], label: adata[1] }));
_vari.val(adata[1]).trigger('change');
BeliJS.update_Varian();
BeliJS.update_Items();
},
update_Items: function(){
new Request({
url: this.PHP + '/item_detail',
sendParam: ['InvID','SatuanID','SupID'],
onSuccess: (adata) => {
if (adata.data) {
var _data = adata.data;
$('#Harga_Beli').val(FoniaJS.FloatToStr(_data.Harga_Beli));
$('#Disk_Rupiah').val(_data.Disk_Rupiah);
$('#Disk_Persen1').val(_data.Disk_Persen1);
$('#Disk_Persen2').val(_data.Disk_Persen2);
$('#Disk_Persen3').val(_data.Disk_Persen3);
$('#Disk_Persen4').val(_data.Disk_Persen4);
$('#Disk_Persen5').val(_data.Disk_Persen5);
this.Hitung_Detail();
}
FoniaJS.setFocus('#Qty');
}
}).send();
},
update_Varian: function(){
new Request.JSONF({
url: this.PHP + '/option_varian',
sendParam: ['InvID','SatuanID','VarianID']
}).send();
},
Hitung_Detail: function(){
var dqty = FoniaJS.StrToFloat($('#Qty').val());
var dharga = FoniaJS.StrToFloat($('#Harga_Beli').val());
var ddiskrp = FoniaJS.StrToFloat($('#Disk_Rupiah').val());
var ddiskp1 = (100.0-FoniaJS.StrToFloat($('#Disk_Persen1').val())) / 100;
var ddiskp2 = (100.0-FoniaJS.StrToFloat($('#Disk_Persen2').val())) / 100;
var ddiskp3 = (100.0-FoniaJS.StrToFloat($('#Disk_Persen3').val())) / 100;
var ddiskp4 = (100.0-FoniaJS.StrToFloat($('#Disk_Persen4').val())) / 100;
var ddiskp5 = (100.0-FoniaJS.StrToFloat($('#Disk_Persen5').val())) / 100;
var dtot = ((dharga - ddiskrp) * ddiskp1 * ddiskp2 * ddiskp3 * ddiskp4 * ddiskp5) * dqty;
var ddis = (dharga * dqty) - dtot;
$('#Total_Diskon').val(FoniaJS.FloatToStr(ddis,2));
$('#Jumlah').val(FoniaJS.FloatToStr(dtot,2));
}
};
+287
View File
@@ -0,0 +1,287 @@
/*******************************************************************
PHP Class : /Controller/Inv/BelireturController
Description : Transaksi Retur Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : May 22th, 2010.
Last Modified : September 21st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var BeliReturJS = {
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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_Beli').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Beli').val());
},
tx_hapus: function(){
if (!$('#No_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Beli').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_Beli'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_Beli').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_Beli').val());
}, 'danger');
},
tx_simpan: function(){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Beli').val('');
}, 'danger');
},
tx_print: function(prt){
if ($('#No_Beli').val()) {
var cetak = new Printer('report/nota/beli_retur');
cetak.add_param("Nomor_Cetak", $('#No_Beli').val());
if (prt) cetak.doPrint(); else cetak.doPreview();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
produk_brow: function(){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'No_Beli','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Beli','CabID','SupID'], {'selectFunc': this.Produk_Comp});
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#Qty').keyup((e) => {
this.Hitung_Detail();
if (parseFloat(e.target.value) == 0) return false;
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Beli');
}).end()
.find('#Harga_Beli').keyup((e) => {
this.Hitung_Detail();
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
});
if ($('#mode_detail').val() == 'insert' && $('#InvID').val() == 0) {
FoniaJS.setFocus('#Nama_Produk');
} else {
this.Hitung_Detail();
this.update_Varian();
FoniaJS.setFocus('#Qty');
}
}, false);
}
}).send();
},
detail_tambah: function(){
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
}
this.detail_produk('insert', 0, 0, 0, 0);
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail=delete','No_Beli','ID='+acell[0]]
}).send();
}, 'danger');
},
detail_simpan: function(){
if (parseInt($('#InvID').val())==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
return;
}
var _mdetail = $('#mode_detail').val();
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','No_Beli','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli'],
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_Beli'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if ((mode ?? '')=='save') sparam = ['mode='+mode,'No_Beli','Tgl_Beli','No_Faktur','CabID','SupID'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
$('#No_Beli').keyup((e) => {
if ((e.which || e.keyCode) == 13) {
if (($("#No_Beli")) && ($("#No_Beli").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
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');
FoniaJS.setFocus('#No_Beli');
} 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');
}
if (ajson.error) FoniaJS.showError(ajson.error);
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','No_Beli']
}).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-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['CabID','Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
$('#Nama_Satuan').val(adata[2]);
var _vari = $('#VarianID');
_vari.append($('<option>', { value: adata[1], label: adata[1] }));
_vari.val(adata[1]).trigger('change');
BeliReturJS.update_Varian();
FoniaJS.setFocus('#Qty');
},
update_Varian: function(){
new Request.JSONF({
url: this.PHP + '/option_varian',
sendParam: ['InvID','SatuanID','VarianID']
}).send();
},
Hitung_Detail: function(){
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * FoniaJS.StrToFloat($('#Harga_Beli').val()), 2));
}
};
+100
View File
@@ -0,0 +1,100 @@
/*******************************************************************
PHP Class : /Controller/Inv/CekhargaController
Description : Informasi Barang & Harga Jual
Created By : Siau Pheng ([email protected]).
Created Date : October 22nd, 2014.
Last Modified : September 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var CekHargaJS = {
PHP: '',
KODE: '',
html5QrcodeScanner: null,
index: function(){
$('#butBrow').click(() => this.produk_brow());
if (FoniaJS.WEB_MOBILE){
html5QrcodeScanner = new Html5Qrcode('qr-reader');
html5QrcodeScanner.start({ facingMode: 'environment' }, { fps: 10, qrbox: 250 }, CekHargaJS.ScanSukses);
} else {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc': this.Produk_Comp});
FoniaJS.setFocus('#Nama_Produk');
}
},
ScanSukses: function(decodedText, decodedResult){
new Request({
url: CekHargaJS.PHP + '/scan_produk',
sendParam: ['Cari_Produk='+decodedText],
onSuccess: (ajson) => {
$('#InvID').val(ajson.InvID);
$('#Kode_Barang').val(ajson.Kode_Barang);
$('#Nama_Barang').val(ajson.Nama_Barang);
$('#Nama_Satuan').val(ajson.Nama_Satuan);
$('#Harga_Jual').val(ajson.Harga_Jual);
$('#Nama_Supplier').val(ajson.Nama_Supplier);
}
}).send();
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#InvID').val(acell[0]);
$('#Kode_Barang').val(acell[1]+' / '+acell[2]);
$('#Nama_Barang').val(acell[3]);
$('#Harga_Jual').val(acell[4]);
$('#Nama_Satuan').val(acell[5]);
this.update_Sup();
},
data_query: function(tipe){
if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#Nama_Barang').val(item.text);
$('#Kode_Barang').val(adata[0]);
$('#Nama_Satuan').val(adata[1]);
$('#Harga_Jual').val(adata[2]);
$('#Nama_Produk').val('').focus();
CekHargaJS.update_Sup();
},
update_Sup: function(){
if (parseInt($('#InvID').val()) == 0) return false;
new Request.JSONF({
url: this.PHP + '/update_sup',
sendParam: ['InvID']
}).send();
}
};
+402
View File
@@ -0,0 +1,402 @@
/*******************************************************************
PHP Class : /Controller/Inv/JualController
Description : Transaksi Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : May 22th, 2010.
Last Modified : September 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var JualJS = {
PHP: '',
KODE: '',
index: function(q){
$('#butTambah').click(() => this.tx_tambah());
$('#butUbah').click(() => this.tx_ubah());
$('#butHapus').click(() => this.tx_hapus());
$('#butPendingBrow').click(() => this.pending_brow());
$('#butPendingSimpan').click(() => this.tx_simpan('pending'));
$('#butSimpan').click(() => this.tx_simpan());
$('#butBatal').click(() => this.tx_batal());
$('#printNota').click(() => this.tx_print());
$('#printPOS').click(() => this.tx_print_pos());
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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_Jual').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_Jual').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
if (-1 !== $('#No_Jual').val().search(/JUAL/i)){
this.data_query('master', 'pending-edit')
return;
}
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Jual').val());
},
tx_hapus: function(){
if (!$('#No_Jual').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Jual').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_Jual','MemberID'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_Jual').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_Jual').val());
}, 'danger');
},
tx_simpan: function(mode){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
return;
}
if (mode == 'pending'){
this.data_query('master', 'pending-save');
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Jual').val('');
}, 'danger');
},
tx_print: function(prt){
if ($('#No_Jual').val()) {
var cetak = new Printer('report/nota/jual');
cetak.add_param("Nomor_Cetak", $('#No_Jual').val());
if (prt) cetak.doPrint(); else cetak.doPreview();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
tx_print_pos: function(){
if ($('#No_Jual').val()) {
var cetak = new PrinterPos('report/nota/pos');
cetak.add_param("Nomor_Cetak", $('#No_Jual').val());
cetak.exec();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
pending_brow: function(){
this.winBPending = FoniaJS.showWindow('BPending', 'Daftar Pending Penjualan', '<div id="divBrowPending">&nbsp;</div>', 'xl', '', () => this.data_query('brow-pending'));
},
pending_select: function(acell){
FoniaJS.closeWindow(this.winBPending);
$('#No_Jual').val(acell[0]);
this.data_query('master', 'pending-edit');
},
pending_delete: function(acell){
FoniaJS.closeWindow(this.winBPending);
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Transaksi Pending "'+acell[0]+'" ?', () => {
$('#No_Jual').val(acell[0]);
this.data_query('master', 'pending-delete');
}, 'danger');
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Grup_MemberID').val(acell[1]);
$('#Nama_Member').val(acell[3]);
this.update_Piutang();
},
produk_brow: function(){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
FoniaJS.setFocus('Nama_Member');
return;
}
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'No_Jual','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID,'Grup_MemberID'],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butBatal'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
.find('#Qty').keyup((e) => {
this.Hitung_Detail(1);
if ((-1!==$.inArray(e.which, [13,9])) && parseInt(e.target.value)>0) FoniaJS.setFocus('#Disk_Rupiah');
}).end()
.find('#Disk_Rupiah').keyup((e) => {
this.Hitung_Detail(1);
if (e.which==13 && FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
}).end()
.find('#Disk_Persen').keyup((e) => {
this.Hitung_Detail(2);
if (13==e.which && FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
});
this.Hitung_Detail(1);
FoniaJS.setFocus('#Qty');
});
}
}).send();
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail=delete','No_Jual','ID='+acell[0]],
onSuccess: () => $('#Nama_Produk').focus()
}).send();
}, 'danger');
},
detail_simpan: function(){
if (FoniaJS.StrToFloat($('#Disk_Persen').val()) >= 100) {
FoniaJS.showInfo('Nilai Diskon diluar batas !');
return false;
}
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','No_Jual','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Harga_Jual','Disk_Rupiah','Disk_Persen'],
onSuccess: () => {
FoniaJS.closeWindow(this.winDetail);
$('#Nama_Produk').val('').focus();
}
}).send();
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="master"){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_Jual'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'No_Jual','Tgl_Jual','CabID','MemberID'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Jual','CabID','Grup_MemberID'], {'selectFunc':this.Produk_Comp});
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
$('#POS_Qty').on({
keyup: (e) => {
(13 == e.which) && $('#Nama_Produk').focus();
},
blur: (e) => {
if (parseInt(e.target.value) == 0) e.target.value = '1.00';
},
click: () => $('#POS_Qty').select()
});
$('#No_Jual').keyup((e) =>{
if ((e.which || e.keyCode) == 13) {
if (($("#No_Jual")) && ($("#No_Jual").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
$('#butBrowMember').click(() => this.member_brow());
$('#Nama_Member').click(() => $('#Nama_Member').select());
this.data_query('tabel-detail');
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
$('#butBrowMember').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
$('#butTambah').addClass('d-none');
$('#butUbah').addClass('d-none');
$('#butHapus').addClass('d-none');
$('#butPrint').addClass('d-none');
$('#butSimpan').removeClass('d-none');
$('#butBatal').removeClass('d-none');
$('#butPendingBrow').addClass('d-none');
$('#butPendingSimpan').addClass('d-none');
if (-1 !== $('#No_Jual').val().search(/JUAL/i)) $('#butPendingSimpan').removeClass('d-none');
if ($('#Nama_Member').val() === '') { FoniaJS.setFocus('#Nama_Member'); }
else FoniaJS.setFocus('#Nama_Produk');
} else {
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
$('#butBrowMember').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
$('#butTambah').removeClass('d-none');
$('#butUbah').removeClass('d-none');
$('#butHapus').removeClass('d-none');
$('#butPrint').removeClass('d-none');
$('#butSimpan').addClass('d-none');
$('#butBatal').addClass('d-none');
$('#butPendingBrow').removeClass('d-none');
$('#butPendingSimpan').addClass('d-none');
FoniaJS.setFocus('#No_Jual');
}
$('#butUbah').prop('disabled', ($('#Lunas').val()==1 ? true : false));
$('#butHapus').prop('disabled', ($('#Lunas').val()==1 ? true : false));
if (ajson.error) FoniaJS.showError(ajson.error);
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','No_Jual']
}).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-pending"){
new Request.JSONF({
url: this.PHP + '/brow_pending',
}).send();
} else if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk','Grup_MemberID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
$('#Grup_MemberID').val(item.data);
JualJS.update_Piutang();
},
Produk_Comp: function(item){
var _qty = FoniaJS.StrToFloat($('#POS_Qty').val());
var adata = item.data.split(':');
// M : Grup_Member
if (adata[0] === 'M') {
$('#MemberID').val(item.value);
$('#Nama_Member').val(item.text);
$('#Grup_MemberID').val(adata[1]);
} else {
// P : Satuan : Varian : Harga_Pokok : Harga_Jual : Stok
//todo: jika stok kosong tidak simpan !!
//if (parseInt(adata[5])>0 || _qty<0){
new Request.JSONF({
url: JualJS.PHP + '/table_detail',
sendParam: ['mode','mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[1],'VarianID='+adata[2],'Qty='+_qty,'Harga_Beli='+adata[3],'Harga_Jual='+adata[4]],
onSuccess: () => $('#POS_Qty').val('1.00')
}).send();
/*} else {
this.winPesan = FoniaJS.showWindow('Pesan', 'Informasi Barang', '<div class="fs-3 text-center text-danger">Barang tidak tersedia atau habis !</div>', 300, [{},{i:'butTutup'}], () => {
$('#winPesan').find('#butTutup').click(() => $('#Nama_Produk').focus()).focus();
});
}*/
}
$('#Nama_Produk').val('').focus();
},
update_Piutang: function(){
new Request.JSONF({
url: this.PHP + '/update_piutang',
sendParam: ['MemberID'],
onSuccess: () => FoniaJS.setFocus('#Nama_Produk')
}).send();
},
Hitung_Detail: function(tipe){
if (tipe==1) $('#Disk_Persen').val(FoniaJS.FloatToStr((FoniaJS.StrToFloat($('#Disk_Rupiah').val())*100) / FoniaJS.StrToFloat($('#Harga_Jual').val()), 2));
if (tipe==2) $('#Disk_Rupiah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Jual').val()) * FoniaJS.StrToFloat($('#Disk_Persen').val()) * 0.01, 2));
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * (FoniaJS.StrToFloat($('#Harga_Jual').val()) - FoniaJS.StrToFloat($('#Disk_Rupiah').val())), 2));
}
};
+291
View File
@@ -0,0 +1,291 @@
/*******************************************************************
PHP Class : /Controller/Inv/MutasiController
Description : Transaksi Mutasi Stok Antar Cabang
Created By : Siau Pheng ([email protected]).
Created Date : February 28th, 2011.
Last Modified : September 28th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MutasiJS = {
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());
$('#printNota').click(() => this.tx_print());
$('#printPOS').click(() => this.tx_print_pos());
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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_Mutasi').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_Mutasi').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showAuth(function(){this.data_query('master', 'edit')}.bind(this), this, 'EDIT '+$('#No_Mutasi').val());
},
tx_hapus: function(){
if (!$('#No_Mutasi').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Mutasi').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_Mutasi'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_Mutasi').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_Mutasi').val());
}, 'danger');
},
tx_simpan: function(){
if ($('#Dari_CabID').val()==0){
FoniaJS.showError("Silakan pilih Dari Cabang !");
return;
}
if ($('#Ke_CabID').val()==0){
FoniaJS.showError("Silakan pilih Ke Cabang !");
return;
}
if ($('#Dari_CabID').val()==$('#Ke_CabID').val()){
FoniaJS.showError("Dari Cabang dan Ke Cabang tidak boleh sama !");
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Mutasi').val('');
}, 'danger');
},
tx_print: function(prt){
if ($('#No_Mutasi').val()) {
var cetak = new Printer('report/nota/mutasi');
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
if (prt) cetak.doPrint(); else cetak.doPreview();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
tx_print_pos: function(){
if ($('#No_Mutasi').val()) {
var cetak = new PrinterPos('report/nota/mutasi_pos');
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
cetak.exec();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
produk_brow: function(){
if ($('#Dari_CabID').val()==0){
FoniaJS.showError("Silakan pilih Dari Cabang !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'No_Mutasi','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
.find('#Qty').keyup((e) => {
this.Hitung_Detail();
if (parseFloat(e.target.value) == 0) return false;
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
});
this.Hitung_Detail();
FoniaJS.setFocus('#Qty');
});
}
}).send();
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail=delete','No_Mutasi','ID='+acell[0]],
onSuccess: () => $('#Nama_Produk').focus()
}).send();
}, 'danger');
},
detail_simpan: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','No_Mutasi','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Dari_CabID','Ke_CabID'],
onSuccess: () => {
FoniaJS.closeWindow(this.winDetail);
$('#Nama_Produk').val('').focus();
}
}).send();
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="master"){
var sparam = ['mode='+mode,'No_Mutasi'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if ((mode ?? '')=='save') sparam = ['mode='+mode,'No_Mutasi','Tgl_Mutasi','Dari_CabID','Ke_CabID','Catatan'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Mutasi','Dari_CabID'], {'selectFunc':this.Produk_Comp});
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
$('#POS_Qty').on({
keyup: (e) => {
(13 == e.which) && $('#Nama_Produk').focus();
},
blur: (e) => {
if (parseInt(e.target.value) == 0) e.target.value = '1.00';
},
click: () => $('#POS_Qty').select()
});
$('#No_Mutasi').keyup((e) => {
if ((e.which || e.keyCode) == 13) {
if (($("#No_Mutasi")) && ($("#No_Mutasi").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
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');
FoniaJS.setFocus('#Nama_Produk');
} 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');
FoniaJS.setFocus('#No_Mutasi');
}
if (ajson.error) FoniaJS.showError(ajson.error);
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','No_Mutasi']
}).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-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk','Dari_CabID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
if ($('#Dari_CabID').val()==0){
FoniaJS.showError("Silakan pilih Dari Cabang !");
return;
}
var _qty = FoniaJS.StrToFloat($('#POS_Qty').val());
var adata = item.data.split(':');
// Satuan : Varian : Harga_Pokok
new Request.JSONF({
url: MutasiJS.PHP + '/table_detail',
sendParam: ['mode','mode_detail=insert','No_Mutasi','InvID='+item.value,'SatuanID='+adata[0],'VarianID='+adata[1],'Qty='+_qty,'Harga_Beli='+adata[2]],
onSuccess: () => $('#POS_Qty').val('1.00')
}).send();
$('#Nama_Produk').val('').focus();
},
Hitung_Detail: function(){
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * FoniaJS.StrToFloat($('#Harga_Beli').val()), 2));
}
};
+266
View File
@@ -0,0 +1,266 @@
/*******************************************************************
PHP Class : /Controller/Inv/OpnameController
Description : Transaksi Opname Stok
Created By : Siau Pheng ([email protected]).
Created Date : May 24th, 2010.
Last Modified : September 28th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var OpnameJS = {
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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_Opname').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_Opname').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Opname').val());
},
tx_hapus: function(){
if (!$('#No_Opname').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_Opname').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_Opname'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_Opname').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_Opname').val());
}, 'danger');
},
tx_simpan: function(){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Opname').val('');
}, 'danger');
},
tx_print: function(prt){
if ($('#No_Opname').val()) {
var cetak = new Printer('report/nota/opname');
cetak.add_param("Nomor_Cetak", $('#No_Opname').val());
if (prt) cetak.doPrint(); else cetak.doPreview();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
produk_brow: function(){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'No_Opname','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianIID='+VarianID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Opname','CabID'], {'selectFunc': this.Produk_Comp});
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan()).end()
.find('#Qty').keyup((e) => {
if (parseFloat(e.target.value) == 0) return false;
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
});
if ($('#mode_detail').val() == 'insert' && $('#InvID').val() == 0) {
FoniaJS.setFocus('#Nama_Produk');
} else {
FoniaJS.setFocus('#Qty');
}
}, false);
}
}).send();
},
detail_tambah: function(){
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
}
this.detail_produk('insert', 0, 0, 0, 0);
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
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_Opname','ID='+acell[0]]
}).send();
}, 'danger');
},
detail_simpan: function(){
if (parseInt($('#InvID').val())==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
return;
}
var _mdetail = $('#mode_detail').val();
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','No_Opname','CabID','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli'],
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_Opname'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if ((mode ?? '')=='save') sparam = ['mode='+mode,'No_Opname','Tgl_Opname','CabID','Catatan'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
$('#No_Opname').keyup((e) => {
if ((e.which || e.keyCode) == 13) {
if (($("#No_Opname")) && ($("#No_Opname").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
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');
FoniaJS.setFocus('#No_Opname');
} 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');
}
if (ajson.error) FoniaJS.showError(ajson.error);
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','No_Opname']
}).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-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['CabID','Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
var adata = item.data.split(':');
// Satuan : Varian : Harga_Pokok : Satuan : Stok
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
$('#VarianID').val(adata[1]);
$('#Harga_Beli').val(adata[2]);
$('#Nama_Satuan1').val(adata[3]);
$('#Nama_Satuan2').val(adata[3]);
$('#Stok').val(adata[4]);
FoniaJS.setFocus('#Qty');
}
};
+130
View File
@@ -0,0 +1,130 @@
/*******************************************************************
PHP Class : /Controller/Inv/OpnamebarangController
Description : Transaksi Penyesuaian Stok Per Barang
Created By : Siau Pheng ([email protected]).
Created Date : October 22nd, 2014.
Last Modified : October 11th, 2026, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var OpnameBarangJS = {
PHP: '',
KODE: '',
html5QrcodeScanner: null,
index: function(){
$('#butSimpan').click(() => this.proses_save());
$('#butBrow').click(() => this.produk_brow());
if (FoniaJS.WEB_MOBILE){
//html5QrcodeScanner = new Html5QrcodeScanner('qr-reader', { fps: 10, qrbox: 250, rememberLastUsedCamera: true, supportedScanTypes: [Html5QrcodeScanType.SCAN_TYPE_CAMERA] });
html5QrcodeScanner = new Html5Qrcode('qr-reader');
html5QrcodeScanner.start({ facingMode: 'environment' }, { fps: 10, qrbox: 250 }, OpnameBarangJS.ScanSukses);
} else {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc': this.Produk_Comp});
FoniaJS.setFocus('#Nama_Produk');
}
},
proses_save: function(){
if ($('#InvID').val()==0) {
FoniaJS.showError('Silakan masukkan Nama Produk!');
return;
}
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['InvID','SatuanID','VarianID','Stok_Fisik','Harga_Beli','PPN'],
onSuccess: (ajson) => {
if (ajson.status === true){
FoniaJS.showInfo('Sukses simpan penyesuaian Stok !');
$('#InvID, #SatuanID, #VarianID, #Harga_Beli #PPN').val(0);
$('#Nama_Produk, #Kode_Barang, #Nama_Barang, #Nama_Satuan').val('');
$('#Stok_Sistem, #Stok_Fisik').val('0.00');
if (FoniaJS.WEB_MOBILE){
this.html5QrcodeScanner.resume();
} else FoniaJS.setFocus('Nama_Produk');
}
}
}).send();
},
ScanSukses: function(decodedText, decodedResult){
new Request({
url: OpnameBarangJS.PHP + '/scan_produk',
sendParam: ['Cari_Produk='+decodedText],
onSuccess: (ajson) => {
$('#InvID').val(ajson.InvID);
$('#SatuanID').val(ajson.SatuanID);
$('#VarianID').val(ajson.VarianID);
$('#Harga_Beli').val(ajson.Harga_Beli);
$('#Kode_Barang').val(ajson.Kode_Barang);
$('#Nama_Barang').val(ajson.Nama_Barang);
$('#Nama_Satuan').val(ajson.Nama_Satuan);
$('#Stok_Sistem').val(ajson.Stok_Sistem);
$('#PPN').val(ajson.PPN);
FoniaJS.setFocus('#Stok_Fisik');
}
}).send();
this.html5QrcodeScanner.pause();
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#InvID').val(acell[0]);
$('#SatuanID').val(acell[1]);
$('#VarianID').val(acell[2]);
$('#Harga_Beli').val(acell[7]);
$('#Kode_Barang').val(acell[3]+' / '+acell[4]);
$('#Nama_Barang').val(acell[5]);
$('#Nama_Satuan').val(acell[6]);
$('#Stok_Sistem').val(acell[8]);
$('#PPN').val(acell[9]);
FoniaJS.setFocus('#Stok_Fisik');
},
data_query: function(tipe){
if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
// Cari by SKU + Barcode
// Satuan : Varian : SKU + Barcode : Harga_Pokok : Satuan : PPN : Stok
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
$('#VarianID').val(adata[1]);
$('#Harga_Beli').val(adata[3]);
$('#Kode_Barang').val(adata[2]);
$('#Nama_Barang').val(item.text);
$('#Nama_Satuan').val(adata[4]);
$('#Stok_Sistem').val(adata[6]);
$('#PPN').val(adata[5]);
FoniaJS.setFocus('#Stok_Fisik');
}
};
+496
View File
@@ -0,0 +1,496 @@
/*******************************************************************
PHP Class : /Controller/Inv/PosController
Description : Transaksi Penjualan POS
Created By : Siau Pheng ([email protected]).
Created Date : August 5th, 2012.
Last Modified : September 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var POSJS = {
PHP: '',
KODE: '',
POLE_DISP: null,
POLE_CONF: {},
Simpan: false,
index: function(){
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['No_Jual','Grup_MemberID'], {'selectFunc': this.Produk_Comp, 'keyFunc': this.Produk_Key});
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
$('#POS_Qty').on({
keyup: (e) => {
(13 == e.which) && $('#Nama_Produk').focus();
},
blur: (e) => {
if (parseInt(e.target.value) == 0) e.target.value = '1.00';
},
click: () => $('#POS_Qty').select()
});
this.data_query('master');
//POLE DISPLAY
this.data_query('config-pole');
},
proses_oc: function(){
var cetak = new PrinterPos('report/nota/open_cash');
cetak.exec();
$('#Nama_Produk').focus();
},
proses_print: function(oc){
var cetak = new PrinterPos('report/nota/pos');
cetak.add_param("Nomor_Cetak", $('#No_Cetak').val());
cetak.add_param("Open_Cash", oc);
cetak.exec();
},
proses_cancel: function(){
if ($('#Total_Item').val()==0) {
FoniaJS.showInfo('Tidak ada item barang !');
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin membatalkan ?<br>Semua item nota ini akan dihapus !', () => this.data_query('master','cancel'), 'danger');
},
nota_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Nota" 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="divBrowNota">&nbsp;</div>');
this.winBNota = FoniaJS.showWindow('BNota', 'Daftar Transaksi', _isi, 'xl', '', () => {
$('#winBNota')
.find('#Cari_Nota').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-nota');
}).end()
.find('#butSearch').click((e) => this.data_query('brow-nota')).end()
.find('#butAll').click(() => {
$('#winBNota').find('#Cari_Nota').val('');
this.data_query('brow-nota');
});
this.data_query('brow-nota');
});
},
nota_print: function(acell){
FoniaJS.closeWindow(this.winBNota);
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
$('#No_Cetak').val(acell[0]);
this.proses_print(0);
}, 'info');
},
nota_select: function(acell){
FoniaJS.closeWindow(this.winBNota);
FoniaJS.showAuth(() => {
$('#No_Jual').val(acell[0]);
this.data_query('master', 'edit');
}, this, 'EDIT POS : '+acell[0]);
},
nota_delete: function(acell){
FoniaJS.closeWindow(this.winBNota);
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
FoniaJS.showAuth(() => {
$('#No_Jual').val(acell[0]);
this.data_query('master', 'delete');
}, this, 'DELETE '+acell[0]);
}, 'danger');
},
pending_brow: function(){
this.winBPend = FoniaJS.showWindow('BPend', 'Daftar Pending POS', '<div id="divBrowPending">&nbsp;</div>', 'xl', '', () => this.data_query('brow-pending'));
},
pending_select: function(acell){
FoniaJS.closeWindow(this.winBPend);
$('#No_Jual').val(acell[0]);
this.data_query('master', 'pending-edit');
},
pending_delete: function(acell){
FoniaJS.closeWindow(this.winBPend);
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Transaksi Pending "'+acell[0]+'" ?', () => {
$('#No_Jual').val(acell[0]);
this.data_query('master', 'pending-delete');
}, 'danger');
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Grup_MemberID').val(acell[1]);
$('#Nama_Member').val(acell[3]);
$('#Info_Member').html(acell[6] || '-');
$('#Nama_Produk').focus();
},
produk_brow: function(){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
FoniaJS.setFocus('Nama_Member');
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
},
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
FoniaJS.setFocus('Nama_Member');
return;
}
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode_detail='+mode,'No_Jual','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID,'Grup_MemberID'],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butSimpan').click(() => this.detail_simpan()).end()
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
.find('#Qty').keyup((e) => {
this.Hitung_Detail(1);
if (-1!==$.inArray(e.which, [13,9]) && parseInt(e.target.value)>0) FoniaJS.setFocus('#Disk_Rupiah');
}).end()
.find('#Disk_Rupiah').keyup((e) => {
this.Hitung_Detail(1);
if (13==e.which && FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
}).end()
.find('#Disk_Persen').keyup((e) => {
this.Hitung_Detail(2);
if (13==e.which && FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
});
this.Hitung_Detail(1);
FoniaJS.setFocus('#Qty');
});
}
}).send();
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','No_Jual','ID='+acell[0]],
onSuccess: () => {
$('#Nama_Produk').focus();
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':'..','a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
}
}
}).send();
},
detail_simpan: function(){
if (FoniaJS.StrToFloat($('#Disk_Persen').val()) >= 100) {
FoniaJS.showInfo('Nilai Diskon diluar batas !');
return false;
}
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','No_Jual','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Harga_Jual','Disk_Rupiah','Disk_Persen'],
onSuccess: () => {
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':$('#Nama_Lengkap').val(),'a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
}
FoniaJS.closeWindow(this.winDetail);
$('#Nama_Produk').val('').focus();
}
}).send();
},
kasir_show: function(){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
FoniaJS.setFocus('Nama_Member');
return;
}
if ($('#Total_Item').val()==0) {
FoniaJS.showInfo('Belum ada transaksi !');
return;
}
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':'Total '+$('#Total_Disp').html(),'a':'C'},{'t':'Tunai / Non Tunai ?','a':'C'}]);
}
new Request({
url: this.PHP + '/form_kasir',
sendParam: ['No_Jual','Total_Nota','Grup_MemberID'],
onSuccess: (ajson) => {
this.winKasir = FoniaJS.showWindow('Kasir', 'Informasi Pembayaran', ajson.html, 'md', '', () => {
$('#butKPend').click(() => this.kasir_pending());
$('#butKBayar').click(() => this.kasir_simpan());
$('#butKBatal').click(() => $('#Nama_Produk').focus());
$('#popTotal_Tunai').keyup((e) => {
if (13 == e.which && parseFloat(e.target.value) == 0){
e.target.value = FoniaJS.FloatToStr($('#Total_Nota').val());
}
if (27 == e.which) {
FoniaJS.closeWindow(this.winKasir);
$('#Nama_Produk').focus();
}
this.kasir_hitung();
if (parseFloat(e.target.value) == 0) return false;
if (13 == e.which) $('#butKBayar').focus();
});
$('#popTotal_Kartu').keyup((e) => {
if (13 == e.which && $('#popKartuID').val() > 0 && parseFloat(e.target.value) == 0){
e.target.value = FoniaJS.FloatToStr($('#Total_Nota').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val()));
}
if (27 == e.which) {
FoniaJS.closeWindow(this.winKasir);
$('#Nama_Produk').focus();
}
this.kasir_hitung();
if (parseFloat(e.target.value) == 0) return false;
if (13 == e.which) $('#butKBayar').focus();
});
$('#popKartuID').change(() => {
if ($('#popKartuID').val() > 0){
if (parseFloat($('#popTotal_Kartu').val()) == 0) $('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Total_Nota').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val())));
$('.ckartu').removeClass('d-none');
} else {
$('#popTotal_Kartu').val('0.00');
$('.ckartu').addClass('d-none');
}
this.kasir_hitung();
FoniaJS.setFocus('#popTotal_Kartu');
});
$('#popTotal_Tunai').val(FoniaJS.FloatToStr($('#Total_Tunai').val()));
$('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Total_Kartu').val()));
$('#popTotal_Bayar').val($('#Total_Bayar').val());
$('#popKartuID').val($('#KartuID').val()).trigger('change');
$('#popNo_Kartu').val($('#No_Kartu').val());
$('#popNama_Kartu').val($('#Nama_Kartu').val());
$('#Total_Disp').html(ajson.Total_Disp);
FoniaJS.setFocus('#popTotal_Tunai');
});
this.Simpan = false;
}
}).send();
},
kasir_hitung: function(){
const totBayar = FoniaJS.StrToFloat($('#popTotal_Tunai').val()) + FoniaJS.StrToFloat($('#popTotal_Kartu').val());
const totSisa = totBayar - FoniaJS.StrToFloat($('#popTotal_Jual').val());
$('#popTotal_Bayar').val(totBayar);
$('#popTotal_Sisa').val(FoniaJS.FloatToStr(totSisa, 2)).removeClass('border-danger border-success').addClass((totSisa < 0) ? 'border-danger' : 'border-success');
},
kasir_simpan: function(){
const totTunai = FoniaJS.StrToFloat($('#popTotal_Tunai').val());
const totKartu = FoniaJS.StrToFloat($('#popTotal_Kartu').val());
const jenKartu = $('#popKartuID').val();
if (jenKartu == 0 && totKartu > 0) {
FoniaJS.showInfo('Silakan pilih Jenis Pembayaran Non Tunai!');
FoniaJS.setFocus('#popKartuID');
return false;
} else if (jenKartu > 0 && totKartu == 0) {
FoniaJS.showInfo('Silakan masukkan Jumlah Pembayaran Non Tunai!');
FoniaJS.setFocus('#popKartuID');
return false;
}
if (FoniaJS.StrToFloat($('#popTotal_Sisa').val())<0) {
FoniaJS.showInfo('Pembayaran Transaksi tidak mencukupi!');
FoniaJS.setFocus('#popTotal_Bayar');
return false;
}
if (this.Simpan==true) {
FoniaJS.showError('Proses pembayaran sedang dilakukan!');
return;
}
this.Simpan = true;
$('#Total_Tunai').val(totTunai);
$('#Total_Kartu').val(totKartu);
$('#Total_Bayar').val($('#popTotal_Bayar').val());
$('#KartuID').val($('#popKartuID').val());
$('#No_Kartu').val($('#popNo_Kartu').val());
$('#Nama_Kartu').val($('#popNama_Kartu').val());
FoniaJS.closeWindow(this.winKasir);
this.data_query('master', 'save');
},
kasir_pending: function(){
FoniaJS.closeWindow(this.winKasir);
this.data_query('master', 'pending-save');
},
data_query: function(tipe, mode){
if (tipe=='master'){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_Jual','No_Cetak'];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'No_Jual','Tgl_Jual','MemberID','Grup_MemberID','Total_Tunai','Total_Kartu','Total_Bayar','KartuID','No_Kartu','Nama_Kartu'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divPOS2').html(ajson.html);
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc': this.Member_Comp});
$('#posPEND').click(() =>this.pending_brow());
$('#posMEMBER').click(() =>this.member_brow());
$('#posBARANG').click(() => this.produk_brow());
$('#posNOTA').click(() => this.nota_brow());
$('#posSIMPAN').click(() => this.kasir_show());
$('#posBATAL').click(() => this.proses_cancel());
FoniaJS.User.Level>1 && $('#posBATAL').hide();
$('#Nama_Member').click(() => $('#Nama_Member').select());
this.data_query('detail');
$('#Nama_Produk').focus();
if (-1!==$.inArray($('#mode').val(), ['print','opencd','saveonly'])){
if ($('#mode').val()=='print') this.proses_print(1);
if ($('#mode').val()=='opencd') this.proses_oc();
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':this.POLE_CONF.END1,'a':'C'},{'t':this.POLE_CONF.END2,'a':'C'}]);
}
} else {
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':this.POLE_CONF.START1,'a':'C'},{'t':this.POLE_CONF.START2,'a':'C'}]);
}
}
}
}).send();
} else if (tipe=='detail'){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['No_Jual']
}).send();
} else if (tipe=='brow-nota'){
new Request.JSONF({
url: this.PHP + '/brow_nota',
sendParam: ['Cari_Nota'],
onSuccess: () => FoniaJS.setFocus('#Cari_Nota')
}).send();
} else if (tipe=='brow-pending'){
new Request.JSONF({
url: this.PHP + '/brow_pending',
}).send();
} else if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
} else if (tipe=='brow-produk'){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk','Grup_MemberID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
} else if (tipe=='config-pole'){
new Request({
url: this.PHP + '/config_pole',
onSuccess: (acfg) => {
if (typeof acfg.pole == 'object'){
this.POLE_CONF = acfg.pole;
if (this.POLE_CONF.ENABLE){
this.POLE_DISP = new PoleDisplay(this.POLE_CONF.PORT);
this.POLE_DISP.Open();
}
}
}
}).send();
}
},
Member_Comp: function(item){
var adata = item.data.split(':');
$('#MemberID').val(item.value);
$('#Grup_MemberID').val(adata[0]);
$('#Info_Member').html(adata[1] || '-');
$('#Nama_Produk').focus();
},
Produk_Comp: function(item){
var _qty = FoniaJS.StrToFloat($('#POS_Qty').val());
var adata = item.data.split(':');
// M : Grup_Member : Info_Member
if (adata[0] === 'M') {
$('#MemberID').val(item.value);
$('#Nama_Member').val(item.text);
$('#Grup_MemberID').val(adata[1]);
$('#Info_Member').html(adata[2] || '-');
} else {
// P : Satuan : Varian : Harga_Pokok : Harga_Jual : Stok
//todo: jika stok kosong tidak simpan !!
//if (parseInt(adata[5])>0 || _qty<0){
new Request.JSONF({
url: POSJS.PHP + '/table_detail',
sendParam: ['mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[1],'VarianID='+adata[2],'Qty='+_qty,'Harga_Beli='+adata[3],'Harga_Jual='+adata[4]],
onSuccess: () => {
$('#POS_Qty').val('1.00');
//POLE DISPLAY
if (POSJS.POLE_CONF.ENABLE){
POSJS.POLE_DISP.Send([{'t':item.text,'a':'L'},{'t':'Total '+$('#Total_Disp').html(),'a':'R'}]);
}
}
}).send();
/*} else {
this.winPesan = FoniaJS.showWindow('Pesan', 'Informasi Barang', '<div class="fs-3 text-center text-danger">Barang tidak tersedia atau habis !</div>', 300, [{},{i:'butTutup'}], () => {
$('#winPesan').find('#butTutup').click(() => $('#Nama_Produk').focus()).focus();
});
}*/
}
$('#Nama_Produk').val('').focus();
},
Produk_Key: function(key, val){
if (key == 13) {
POSJS.kasir_show();
} else if (key == 117) {//f6
POSJS.proses_oc();
} else if (key == 119) {//f8
POSJS.produk_add();
} else if (key == 120) {//f9
POSJS.produk_brow();
}
},
Hitung_Detail: function(tipe){
if (tipe==1) $('#Disk_Persen').val(FoniaJS.FloatToStr((FoniaJS.StrToFloat($('#Disk_Rupiah').val())*100) / FoniaJS.StrToFloat($('#Harga_Jual').val()), 2));
if (tipe==2) $('#Disk_Rupiah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Jual').val()) * FoniaJS.StrToFloat($('#Disk_Persen').val()) * 0.01, 2));
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * (FoniaJS.StrToFloat($('#Harga_Jual').val()) - FoniaJS.StrToFloat($('#Disk_Rupiah').val())), 2));
}
};
+40
View File
@@ -0,0 +1,40 @@
/*******************************************************************
Module : /scripts/locale/datepicker.id.js
Desc. : Locale ID Datepicker
Created By : Siau Pheng ([email protected]).
Created Date : January 28th, 2013.
Last Modofied : August 20th, 2026.
(c) 2013 - 2026, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
!(function (a) {
if (typeof a.fn.datepicker === 'undefined') return;
a.fn.datepicker.dates.id = {
days: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
daysShort: ["Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"],
daysMin: ["Mg", "Sn", "Sl", "Rb", "Km", "Jm", "Sb"],
months: [
"Januari",
"Februari",
"Maret",
"April",
"Mei",
"Juni",
"Juli",
"Agustus",
"September",
"Oktober",
"November",
"Desember",
],
monthsShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agt", "Sep", "Okt", "Nov", "Des"],
today: "Hari Ini",
monthsTitle: "Bulan",
clear: "Kosongkan",
weekStart: 0,
format: "dd-mm-yyyy",
};
})(jQuery);
+31
View File
@@ -0,0 +1,31 @@
/*******************************************************************
Module : /scripts/locale/fonia.id.js
Desc. : Locale Fonia Module
Created By : Siau Pheng ([email protected]).
Created Date : January 28th, 2013.
Last Modofied : November 22nd, 2019
(c) 2013 - 2019, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
!(function (a) {
if (typeof FoniaJS === 'undefined') return;
FoniaJS.locale('id', {
Fonia: {
sess_expire: 'Session Anda telah berakhir, silakan login kembali!',
page404: 'Halaman aplikasi belum tersedia!',
input_passwd: 'Silakan masukkan Password!',
input_userid: 'Silakan masukkan User ID!',
auth_super: 'Persetujuan Supervisor',
auth_user: 'Validasi Operator',
auth_wait_msg: 'Menunggu disetujui oleh<br>Supervisor Anda...',
cancel: 'Batal',
auth_fail: 'Proses gagal!<br>Menunggu terlalu lama ...',
auth_success: 'Proses disetujui!',
but_add: 'Tambah',
but_edit: 'Ubah'
}
});
})(jQuery);
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
Module : /scripts/locale/moment.id.js
Desc. : Locale Moment
Created By : Siau Pheng ([email protected]).
Created Date : January 28th, 2013.
Last Modofied : November 22nd, 2019
(c) 2013 - 2019, 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
!(function (a) {
if (typeof a.fn.moment === 'undefined') return;
a.fn.moment.locale('id', {
months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
longDateFormat : {
LT : 'HH.mm',
LTS : 'HH.mm.ss',
L : 'DD-MM-YYYY',
LL : 'D MMMM YYYY',
LLL : 'D MMMM YYYY [pukul] HH.mm',
LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm'
},
meridiemParse: /pagi|siang|sore|malam/,
meridiemHour : function (hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
return hour;
} else if (meridiem === 'siang') {
return hour >= 11 ? hour : hour + 12;
} else if (meridiem === 'sore' || meridiem === 'malam') {
return hour + 12;
}
},
meridiem : function (hours, minutes, isLower) {
if (hours < 11) {
return 'pagi';
} else if (hours < 15) {
return 'siang';
} else if (hours < 19) {
return 'sore';
} else {
return 'malam';
}
},
calendar : {
sameDay : '[Hari ini pukul] LT',
nextDay : '[Besok pukul] LT',
nextWeek : 'dddd [pukul] LT',
lastDay : '[Kemarin pukul] LT',
lastWeek : 'dddd [lalu pukul] LT',
sameElse : 'L'
},
relativeTime : {
future : 'dalam %s',
past : '%s yang lalu',
s : 'beberapa detik',
ss : '%d detik',
m : 'semenit',
mm : '%d menit',
h : 'sejam',
hh : '%d jam',
d : 'sehari',
dd : '%d hari',
M : 'sebulan',
MM : '%d bulan',
y : 'setahun',
yy : '%d tahun'
},
week : {
dow : 1, // Monday is the first day of the week.
doy : 7 // The week that contains Jan 7th is the first week of the year.
}
});
a.fn.moment.locale('id');
})(jQuery);
+84
View File
@@ -0,0 +1,84 @@
/*******************************************************************
PHP Class : /Controller/AuthController
Description : Kontrol Login Session & Auth Supervisi
Created By : Siau Pheng ([email protected]).
Created Date : January 15th, 2008.
Last Modified : August 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
$(document).ready(function(){
$('#butLogin').click(LoginJS.Proses_Login);
$('#Username').keydown((e) => {
if (e.which==13) $('#Password').focus();
});
$('#Password').keydown((e) => {
if (e.which==13) $('#butLogin').trigger('click');
});
LoginJS.Tampil_Login();
$(document).on('contextmenu', (e) => e.preventDefault());
$.backstretch([
[
{ width: 1280, url: "assets/images/bs/toko_1280.jpg" },
{ width: 960, url: "assets/images/bs/toko_960.jpg" }
],
[
{ width: 1280, url: "assets/images/bs/rak_1280.jpg" },
{ width: 960, url: "assets/images/bs/rak_960.jpg" }
],
[
{ width: 1280, url: "assets/images/bs/shop_1280.jpg" },
{ width: 960, url: "assets/images/bs/shop_960.jpg" }
]
], {
duration: 6000,
transition: 'push_left|push_right|cover_up|cover_down|fade',
transitionDuration: 600
});
});
var LoginJS = {
Tampil_Login: function(){
var Username = FoniaJS.getCookie('Username');
if (Username != '') {
$('#Username').val(Username);
FoniaJS.setFocus('#Password');
} else {
FoniaJS.setFocus('#Username');
}
},
Proses_Login: function(){
if (!$('#Username').val()){
$('#Username').focus();
FoniaJS.showError('Silahkan masukkan Username !');
return false;
}
if (!$('#Password').val()){
$('#Password').focus();
FoniaJS.showError('Silahkan masukkan Password !');
return false;
}
new Request({
url: 'auth/login',
sendParam: ['Username','Password'],
onSuccess: (ajson) => {
if (ajson.status === true){
FoniaJS.setCookie('Username', $('#Username').val(), 365);
$('#divLoginMsg').html(ajson.message).removeClass('d-none');
$('.input-group').addClass('d-none');
setTimeout(() => {self.location = ajson.token ?? '';}, 1600);
}else{
FoniaJS.showInfo(ajson.message, 3000);
if (ajson.redir) setTimeout(() => {self.location = ajson.redir;}, 600);
}
}
}).send();
}
};
+60
View File
@@ -0,0 +1,60 @@
/*******************************************************************
PHP Class : /Controller/Member/BaruController
Description : Pembuatan Member Baru
Created By : Siau Pheng ([email protected]).
Created Date : February 8th, 2012.
Last Modified : September 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MemberBaruJS = {
PHP: '',
KODE: '',
index: function(){
$('#butTambah').click(() => this.proses_add());
$('#butSimpan').click(() => this.proses_save());
this.data_query('view');
},
proses_add: function(){
this.data_query('add');
},
proses_save: function(){
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['MemberID','Grup_MemberID','Kode_Member','Nama_Member','Alamat_Member','Kota_Member','Telp_Member','KTP_Member','Tgl_Lahir','Tgl_Daftar'],
onSuccess: (ajson) => {
if (ajson.status == true) {
this.data_query('view');
FoniaJS.showInfo('Sukses simpan Member Baru!');
} else {
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
}
}).send()
},
data_query: function(mode){
new Request({
url: this.PHP + '/form_master',
sendParam: ['mode='+mode],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
if ($.inArray($('#mode').val(), ['add']) !== -1) {
$("#butTambah").prop('disabled', true);
$("#butSimpan").prop('disabled', false);
FoniaJS.setFocus('#Kode_Member');
} else {
$("#butTambah").prop('disabled', false);
$("#butSimpan").prop('disabled', true);
}
}
}).send()
}
};
+95
View File
@@ -0,0 +1,95 @@
/*******************************************************************
PHP Class : /Controller/Member/PointController
Description : Informasi Point Member
Created By : Siau Pheng ([email protected]).
Created Date : October 22nd, 2014.
Last Modified : September 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MemberPointJS = {
PHP: '',
KODE: '',
html5QrcodeScanner: null,
index: function(){
$('#butBrow').click(() => this.member_brow());
if (FoniaJS.WEB_MOBILE){
html5QrcodeScanner = new Html5Qrcode('qr-reader');
html5QrcodeScanner.start({ facingMode: 'environment' }, { fps: 10, qrbox: 250 }, MemberPointJS.ScanSukses);
} else {
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc': this.Member_Comp});
FoniaJS.setFocus('#Nama_Member');
}
this.data_query('table-point');
},
ScanSukses: function(decodedText, decodedResult){
new Request({
url: MemberPointJS.PHP + '/scan_member',
sendParam: ['Cari_Member='+decodedText],
onSuccess: (ajson) => {
$('#MemberID').val(ajson.MemberID);
$('#Kode_Member').val(ajson.Kode_Member);
$('#Nama_Lengkap').val(ajson.Nama_Lengkap);
$('#Nama_Grup').val(ajson.Nama_Grup);
MemberPointJS.data_query('table-point');
}
}).send();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Kode_Member').val(acell[1]);
$('#Nama_Lengkap').val(acell[2]);
$('#Nama_Grup').val(acell[5]);
this.data_query('table-point');
},
data_query: function(tipe){
if (tipe=="table-point"){
new Request.JSONF({
url: this.PHP + '/table_point',
sendParam: ['MemberID']
}).send();
} else if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
var adata = item.data.split(':');
$('#MemberID').val(item.value);
$('#Kode_Member').val(adata[0]);
$('#Nama_Lengkap').val(item.text);
$('#Nama_Grup').val(adata[1]);
$('#Nama_Member').val('').focus();
MemberPointJS.data_query('table-point');
}
};
+286
View File
@@ -0,0 +1,286 @@
/*******************************************************************
PHP Class : /Controller/Member/TukarController
Description : Transaksi Penukaran Point Member
Created By : Siau Pheng ([email protected]).
Created Date : December 10th, 2017.
Last Modified : September 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MemberTukarJS = {
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">&nbsp;</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');
});
},
tx_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#No_TX').val(acell[0]);
this.data_query('master', 'view');
},
tx_tambah: function(){
this.data_query('master', 'add');
},
tx_ubah: function(){
if (!$('#No_TX').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_TX').val());
},
tx_hapus: function(){
if (!$('#No_TX').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_TX').val()+'</strong> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['No_TX'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#No_TX').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_TX').val());
}, 'danger');
},
tx_simpan: function(){
if ($('#Point_TipeID').val()==0){
FoniaJS.showError("Silakan pilih Tipe Point !");
return;
}
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
return;
}
if ($('#InvPID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Barang !");
return;
}
if (FoniaJS.StrToFloat($('#Qty').val())==0){
FoniaJS.showError("Silakan masukkan Nilai Qty !");
return;
}
var spoint = parseInt($('#Sisa_Point').val());
var tpoint = parseInt($('#Nilai_Point').val());
if (spoint < tpoint) {
FoniaJS.showInfo("Sisa Point Member tidak mencukupi !");
return;
}
this.data_query('master', 'save');
},
tx_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_TX').val('');
}, 'danger');
},
tx_print: function(){
if ($('#No_TX').val()) {
var cetak = new PrinterPos('report/nota/tukarpoint_pos');
cetak.add_param("Nomor_Cetak", $('#No_TX').val());
cetak.exec();
return;
}
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
member_brow: function(){
if ($('#Point_TipeID').val()==0){
FoniaJS.showError("Silakan pilih Tipe Point !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[3]);
$('#Sisa_Point').val(acell[6]);
},
barang_brow: function(){
if ($('#Point_TipeID').val()==0){
FoniaJS.showError("Silakan pilih Tipe Point !");
return;
}
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Barang" 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="divBrowBarang">&nbsp;</div>');
this.winBBarang = FoniaJS.showWindow('BBarang', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBBarang')
.find('#Cari_Barang').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-barang');
}).end()
.find('#butSearch').click(() => this.data_query('brow-barang')).end()
.find('#butAll').click(() => {
$('#winBBarang').find('#Cari_Barang').val('');
this.data_query('brow-barang');
});
this.data_query('brow-barang');
});
},
barang_select: function(acell){
FoniaJS.closeWindow(this.winBBarang);
$('#InvPID').val(acell[0]);
$('#Nama_Barang').val(acell[2]);
$('#Nilai_Barang').val(acell[3]);
$('#Point').val(acell[4]);
FoniaJS.setFocus('#Qty');
this.Hitung_Point();
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="master"){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_TX'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'No_TX','Tgl_TX','Point_TipeID','InvPID','MemberID','Nilai_Barang','Qty','Point'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', ['Point_TipeID'], {'selectFunc':this.Member_Comp});
FoniaJS.AutoComplete('#Nama_Barang', this.PHP + '/auto_barang', ['Point_TipeID'], {'selectFunc':this.Barang_Comp});
$('#No_TX').keyup((e) =>{
if ((e.which || e.keyCode) == 13) {
if (($("#No_TX")) && ($("#No_TX").val() !== '')) this.data_query('master');
}
});
$('#butBrow').click(() => this.tx_brow());
$('#butBrowMember').click(() => this.member_brow());
$('#butBrowBarang').click(() => this.barang_brow());
$('#Qty').keyup(() => this.Hitung_Point());
if ($.inArray($("#mode").val(),['add','edit']) !== -1) {
$('#butBrow').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
$('#butBrowMember').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
$('#butBrowBarang').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
$('#butTambah').addClass('d-none');
$('#butUbah').addClass('d-none');
$('#butHapus').addClass('d-none');
$('#butPrint').addClass('d-none');
$('#butSimpan').removeClass('d-none');
$('#butBatal').removeClass('d-none');
FoniaJS.setFocus('#Nama_Member');
} else {
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
$('#butBrowMember').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
$('#butBrowBarang').prop('disabled', true).removeClass('btn-info').addClass('btn-secondary');
$('#butTambah').removeClass('d-none');
$('#butUbah').removeClass('d-none');
$('#butHapus').removeClass('d-none');
$('#butPrint').removeClass('d-none');
$('#butSimpan').addClass('d-none');
$('#butBatal').addClass('d-none');
this.Hitung_Point();
FoniaJS.setFocus('#No_TX');
}
if (FoniaJS.User.Level > 1) {
$('#butUbah').prop('disabled', true);
$('#butHapus').prop('disabled', true);
}
if (ajson.error) FoniaJS.showError(ajson.error);
}
}).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-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member','Point_TipeID']
}).send();
} else if (tipe=="brow-barang"){
new Request.JSONF({
url: this.PHP + '/brow_barang',
sendParam: ['Cari_Barang','Point_TipeID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Barang')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
$('#Sisa_Point').val(item.data);
$('#Nama_Barang').focus();
},
Barang_Comp: function(item){
var adata = item.data.split(':');
$('#InvPID').val(item.value);
$('#Nilai_Barang').val(adata[1]);
$('#Qty').val(1);
$('#Point').val(adata[2]);
FoniaJS.setFocus('#Qty');
this.Hitung_Point();
},
oc_Tipe: function(){
//
},
Hitung_Point: function(){
var qty = FoniaJS.StrToFloat($('#Qty').val());
var point = FoniaJS.StrToFloat($('#Point').val());
$('#Nilai_Point').val(FoniaJS.FloatToStr(qty * point,0));
}
};
+151
View File
@@ -0,0 +1,151 @@
/*******************************************************************
PHP Class : /Controller/MonitorController
Description : Halaman Utama Display Monitor
Created By : Siau Pheng ([email protected]).
Created Date : May 24th, 2010.
Last Modified : October 20th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
$(document).ready(() => {
$("#preloader").remove();
MonJS.index();
});
var socket = io(window.location.host, { 'path': '/io' });
// MONITOR
socket.on('monitor-data', (adata) => {
//console.log('reply monitor-data', adata);
if ($('#monContent').length === 0) socket.emit('monitor-done');
if (typeof(adata.data) === 'object') {
if (parseInt(adata.data.total)==0) MonJS.IDLE_TIME++; else MonJS.IDLE_TIME = 0;
var show_thank = (parseInt(adata.data.thank)==1) ? true : false;
if (MonJS.IDLE_TIME === 0) {
if (MonJS.ISSHOW_THANK) MonJS.data_query('close-thank');
if (!MonJS.ISSHOW_POS) MonJS.show_pos();
if (adata.data.total !== MonJS.TOTAL_SHOP) {
if ($('#divShop').length) MonJS.data_query('info-shop');
MonJS.TOTAL_SHOP = adata.data.total;
}
} else {
if (MonJS.ISSHOW_POS) MonJS.hide_pos();
if (MonJS.IDLE_TIME < MonJS.DEF_THANK_TIME) {
if (show_thank && !MonJS.ISSHOW_THANK) {
MonJS.show_thank();
MonJS.ISSHOW_THANK = true;
}
} else {
if (MonJS.ISSHOW_THANK) MonJS.data_query('close-thank');
}
}
}
});
var MonJS = {
PHP: 'monitor',
DEF_PROMO_DUR: 10,//not used
DEF_THANK_TIME: 5,
DEF_IDLE_TIME: 5,//not used
IDLE_TIME: 0,
ISSHOW_POS: false,
ISSHOW_THANK: false,
ID_CABANG: 0,
TOTAL_SHOP: 0,
index: function(){
new Request({
url: this.PHP + '/index',
onSuccess: (ajson) => {
$('#monContent').html(ajson.html);
this.data_query('config');
this.data_query('info-promo');
this.data_query('info-iklan');
this.hide_pos();
this.hide_thank();
}
}).send();
},
hide_pos: function(){
this.ISSHOW_POS = false;
$('#divBanner').removeClass('d-none');
$('#divShop').addClass('d-none');
},
show_pos: function(){
this.ISSHOW_POS = true;
$('#divBanner').addClass('d-none');
$('#divShop').removeClass('d-none');
this.data_query('shop');
},
hide_thank: function(){
$('#divBlur').addClass('d-none');
$('#divThank').addClass('d-none');
},
show_thank: function(){
$('#divBlur').removeClass('d-none');
$('#divThank').removeClass('d-none');
this.data_query('thank');
},
data_query: function(tipe){
if (tipe == 'config'){
$.post(this.PHP + '/config', {}, (ajson) => {
if (ajson.PROMO_DURASI) MonJS.DEF_PROMO_DUR = ajson.PROMO_DURASI;
if (ajson.PROMO_IDLE) MonJS.DEF_IDLE_TIME = ajson.PROMO_IDLE;
if (ajson.ID_CABANG) MonJS.ID_CABANG = ajson.ID_CABANG;
if (ajson.BANNER_TEXT) $('#divBanner').html(ajson.BANNER_TEXT);
if (socket.active) {
socket.emit('monitor-done');
socket.emit('monitor-check', { 'UserID': FoniaJS.User.UID, 'CabID': MonJS.ID_CABANG });
}
}, 'json');
} else if (tipe == 'info-iklan'){
$.post(this.PHP + '/info_iklan', {}, (ajson) => {
$('#divIklan').html(ajson.html);
const car_iklan = new bootstrap.Carousel('#divIklan', {
//interval: MonJS.DEF_PROMO_DUR
});
});
} else if (tipe == 'info-promo'){
$.post(this.PHP + '/info_promo', {}, (ajson) => {
$('#divPromo').html(ajson.html);
const car_iklan = new bootstrap.Carousel('#divPromo', {
//interval: MonJS.DEF_PROMO_DUR
});
});
/*} else if (tipe == 'count-delay'){ //todo: ganti ke socket-io
$.post(this.PHP + '/count_delay', {}, (ajson) => {
if (parseInt(ajson.total)==0) this.IDLE_TIME++; else this.IDLE_TIME = 0;
this.ISSHOW_THANK = (parseInt(ajson.thank)==1) ? true : false;
}, 'json');*/
} else if (tipe == 'shop'){
$.post(this.PHP + '/shop', {}, (ajson) => {
$('#divShop').html(ajson.html);
});
} else if (tipe == 'thank'){
$.post(this.PHP + '/thank', {}, (ajson) => {
$('#divThank').html(ajson.html);
this.TOTAL_SHOP = 0;
});
} else if (tipe == 'close-thank'){
$.post(this.PHP + '/close_thank', {}, () => {
this.ISSHOW_THANK = false;
this.hide_thank();
});
} else if (tipe == 'info-shop'){
$.post(this.PHP + '/info_shop', {}, (ajson) => {
$('#Total_Harga').html(ajson.Total_Harga);
$('#Info_Qty').html(ajson.Info_Qty);
$('#Info_Barang').html(ajson.Info_Barang);
if (parseFloat($('#Total_Harga').html()) == 0) this.IDLE_TIME++; else this.IDLE_TIME = 0;
}, 'json');
}
}
};
+97
View File
@@ -0,0 +1,97 @@
/*******************************************************************
PHP Class : /Controller/Ppob/PpobtxController
Description : Transaksi PPOB
Created By : Siau Pheng ([email protected]).
Created Date : October 6th, 2017.
Last Modified : September 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PPOBTXJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('tabel-detail');
$('#Cari_TX').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-detail');
});
$('#butSearch').click(() => this.data_query('tabel-detail'));
$('#butAll').click(() => {
$('#Cari_TX').val('');
this.data_query('tabel-detail');
});
FoniaJS.setFocus('#Cari_TX');
},
proses_print: function(oc, no_cetak){
var cetak = new PrinterPos('report/nota/ppob');
cetak.add_param("Nomor_Cetak", no_cetak);
cetak.add_param("Open_Cash", oc);
cetak.exec();
},
proses_delete: function(no_tx){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=delete','No_TX='+no_tx,'Tgl_From','Tgl_To','Cari_TX']
}).send();
},
proses_reproc: function(no_tx){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=reproc','No_TX='+no_tx,'Tgl_From','Tgl_To','Cari_TX']
}).send();
},
nota_print: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
this.proses_print(0, acell[0]);
}, 'info');
},
nota_delete: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
FoniaJS.showAuth(() => this.proses_delete(acell[0]), this, 'DELETE '+acell[0]);
}, 'danger');
},
nota_reproc: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin proses ulang "'+acell[0]+'" ?', () => this.proses_reproc(acell[0]), 'warning');
},
nota_detail: function(acell){
new Request({
url: this.PHP + '/form_tx',
sendParam: ['No_TX='+acell[0]],
onSuccess: (adata) => {
this.winInfo = FoniaJS.showWindow('Info', 'Informasi Transaksi', adata.html, 'md');
}
}).send();
},
saldo_ppob: function(){
new Request({
url: this.PHP + '/form_saldo',
onSuccess: (adata) => {
var _obtn = $('button:contains("Saldo")');
if (_obtn) _obtn.html('<i class="bi-coin me-2"></i>Saldo Rp. '+adata.Saldo);
}
}).send();
},
data_query: function(tipe){
if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['Tgl_From','Tgl_To','Cari_TX']
}).send();
}
}
};
+306
View File
@@ -0,0 +1,306 @@
/*******************************************************************
PHP Class : /Controller/Ppob/PrabayarController
Description : Transaksi Prabayar PPOB
Created By : Siau Pheng ([email protected]).
Created Date : March 15th, 2017.
Last Modified : September 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PrabayarJS = {
PHP: '',
KODE: '',
POLE_DISP: null,
POLE_CONF: {},
Simpan: false,
KATE_PREFIX: [1,2,3,4],
KATE_TOKEN: [5],
index: function(){
$('#Cari_PPOB').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-tx');
});
$('#butSearch').click((e) => this.data_query('tabel-tx'));
$('#butAll').click(() => {
$('#Cari_PPOB').val('');
this.data_query('tabel-tx');
});
this.data_query('master');
//POLE DISPLAY
this.data_query('pole-config');
},
proses_print: function(oc, no_cetak){
var cetak = new PrinterPos('apps/php/repo/nota.php');
cetak.add_param("data", "ppob-pos");
cetak.add_param("Nomor_Cetak", no_cetak);
cetak.add_param("Open_Cash", oc);
cetak.exec();
},
proses_delete: function(){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=delete','No_TX']
}).send();
},
proses_reproc: function(ft){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=reproc','No_TX','FT='+ft]
}).send();
},
proses_cancel: function(){
FoniaJS.showConfirm('Konfirmasi', 'Apakah Anda yakin ingin membatalkan ?', () => this.data_query('master','cancel'), 'danger');
},
nota_print: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
this.proses_print(0, acell[0]);
}, 'info');
},
nota_delete: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
FoniaJS.showAuth(() => {
$('#No_TX').val(acell[0]);
this.proses_delete();
}, this, 'DELETE '+acell[0]);
}, 'danger');
},
nota_reproc: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin proses ulang "'+acell[0]+'" ?', () => {
$('#No_TX').val(acell[0]);
this.proses_reproc();
}, 'warning');
},
nota_detail: function(acell){
new Request({
url: this.PHP + '/form_tx',
sendParam: ['No_TX='+acell[0]],
onSuccess: (adata) => {
this.winInfo = FoniaJS.showWindow('Info', 'Informasi Transaksi', adata.html, 'lg');
}
}).send();
},
kasir_show: function(){
if ($('#Tujuan').val()=='') {
FoniaJS.showInfo('Silahkan masukkan Nomor Tujuan !');
FoniaJS.setFocus('#Tujuan');
return;
}
if ($('#ProdukID').val()==0) {
FoniaJS.showInfo('Silahkan pilih Jenis Produk !');
$('#ProdukID').focus();
return;
}
new Request({
url: this.PHP + '/form_kasir',
sendParam: ['No_TX','Harga_Jual'],
onSuccess: (adata) => {
this.winKasir = FoniaJS.showWindow('Kasir', 'Informasi Pembayaran', adata.html, 'lg', '', () => {
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':'Total '+adata.Total_Disp,'a':'C'},{'t':'Tunai / Non Tunai ?','a':'C'}]);
}
$('#butKBayar').click(() => this.kasir_simpan());
$('#butKBatal').click(() => $('#Tujuan').focus());
$('#popTotal_Tunai').keyup((e) => {
if (13 == e.which && parseFloat(e.target.value) == 0){
e.target.value = FoniaJS.FloatToStr($('#Harga_Jual').val());
}
if (27 == e.which) {
FoniaJS.closeWindow(this.winKasir);
$('#Tujuan').focus();
}
this.kasir_hitung();
if (parseFloat(e.target.value) == 0) return false;
if (13 == e.which) $('#butKBayar').focus();
});
$('#popTotal_Kartu').keyup((e) => {
if (13 == e.which && $('#popKartuID').val() > 0 && parseFloat(e.target.value) == 0){
e.target.value = FoniaJS.FloatToStr($('#Harga_Jual').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val()));
}
if (27 == e.which) {
FoniaJS.closeWindow(this.winKasir);
$('#Tujuan').focus();
}
this.kasir_hitung();
if (parseFloat(e.target.value) == 0) return false;
if (13 == e.which) $('#butKBayar').focus();
});
$('#popKartuID').change(() => {
if ($('#popKartuID').val() > 0){
if (parseFloat($('#popTotal_Kartu').val()) == 0) $('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Harga_Jual').val()-FoniaJS.StrToFloat($('#popTotal_Tunai').val())));
$('.ckartu').removeClass('d-none');
} else {
$('#popTotal_Kartu').val('0.00');
$('.ckartu').addClass('d-none');
}
this.kasir_hitung();
FoniaJS.setFocus('#popTotal_Kartu');
});
$('#popTotal_Tunai').val(FoniaJS.FloatToStr($('#Total_Tunai').val()));
$('#popTotal_Kartu').val(FoniaJS.FloatToStr($('#Total_Kartu').val()));
$('#popTotal_Bayar').val($('#Total_Bayar').val());
$('#popKartuID').val($('#KartuID').val()).trigger('change');
$('#popNo_Kartu').val($('#No_Kartu').val());
$('#popNama_Kartu').val($('#Nama_Kartu').val());
$('#Total_Disp').html(adata.Total_Disp);
FoniaJS.setFocus('#popTotal_Tunai');
});
this.Simpan = false;
}
}).send();
},
kasir_hitung: function(){
const totBayar = FoniaJS.StrToFloat($('#popTotal_Tunai').val()) + FoniaJS.StrToFloat($('#popTotal_Kartu').val());
const totSisa = totBayar - FoniaJS.StrToFloat($('#popTotal_Jual').val());
$('#popTotal_Bayar').val(totBayar);
$('#popTotal_Sisa').val(FoniaJS.FloatToStr(totSisa, 2)).removeClass('border-danger border-success').addClass((totSisa < 0) ? 'border-danger' : 'border-success');
},
kasir_simpan: function(){
const totTunai = FoniaJS.StrToFloat($('#popTotal_Tunai').val());
const totKartu = FoniaJS.StrToFloat($('#popTotal_Kartu').val());
const jenKartu = $('#popKartuID').val();
if (jenKartu == 0 && totKartu > 0) {
FoniaJS.showInfo('Silakan pilih Jenis Pembayaran Non Tunai!');
FoniaJS.setFocus('#popKartuID');
return false;
} else if (jenKartu > 0 && totKartu == 0) {
FoniaJS.showInfo('Silakan masukkan Jumlah Pembayaran Non Tunai!');
FoniaJS.setFocus('#popKartuID');
return false;
}
if (FoniaJS.StrToFloat($('#popTotal_Sisa').val())<0) {
FoniaJS.showInfo('Pembayaran Transaksi tidak mencukupi!');
FoniaJS.setFocus('#popTotal_Bayar');
return false;
}
if (this.Simpan==true) {
FoniaJS.showError('Proses pembayaran sedang dilakukan!');
return;
}
this.Simpan = true;
$('#Total_Tunai').val(totTunai);
$('#Total_Kartu').val(totKartu);
$('#Total_Bayar').val($('#popTotal_Bayar').val());
$('#KartuID').val($('#popKartuID').val());
$('#No_Kartu').val($('#popNo_Kartu').val());
$('#Nama_Kartu').val($('#popNama_Kartu').val());
FoniaJS.closeWindow(this.winKasir);
this.data_query('master', 'save');
},
data_query: function(tipe, mode){
if (tipe=='master'){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_TX'];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'Tujuan','No_HP','KateID','OpeID','ProdukID','Total_Tunai','Total_Kartu','Total_Bayar','KartuID','No_Kartu','Nama_Kartu'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divPOS2').html(ajson.html);
$('#ppobSIMPAN').click(() => this.kasir_show());
$('#ppobBATAL').click(() => this.proses_cancel());
this.data_query('tabel-tx');
this.oc_KateID();
$('#Tujuan').on({
keyup: (e) => {
if (e.target.value.length == 4 || 13 == e.which) this.oc_Tujuan();
},
blur: () => this.oc_Tujuan(),
click: () => $('#Tujuan').select()
});
$('#No_HP').click(() => $('#No_HP').select());
$('#KateID').focus();
if (-1!==$.inArray($('#mode').val(), ['reproc'])){
this.proses_reproc(1);
if ($.inArray(parseInt($('#KateID').val()), this.KATE_TOKEN) !== -1) {
if (socket.active) socket.emit('ppob-check', { 'UserID': FoniaJS.User.UID, 'CabID': FoniaJS.User.CabID });
} else {
this.proses_print(1, $('#No_TX').val());
}
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':this.POLE_CONF.END1,'a':'C'},{'t':this.POLE_CONF.END2,'a':'C'}]);
}
} else {
//POLE DISPLAY
if (this.POLE_CONF.ENABLE){
this.POLE_DISP.Send([{'t':this.POLE_CONF.START1,'a':'C'},{'t':this.POLE_CONF.START2,'a':'C'}]);
}
}
}
}).send();
} else if (tipe=='tabel-tx'){
new Request.JSONF({
url: this.PHP + '/table_tx',
sendParam: ['Cari_PPOB']
}).send();
} else if (tipe=='pole-config'){
new Request({
url: this.PHP + '/config_pole',
onSuccess: (acfg) => {
if (typeof acfg.pole == 'object'){
this.POLE_CONF = acfg.pole;
if (this.POLE_CONF.ENABLE){
this.POLE_DISP = new PoleDisplay(this.POLE_CONF.PORT);
this.POLE_DISP.Open();
}
}
}
}).send();
}
},
oc_KateID: function(){
if ($.inArray(parseInt($('#KateID').val()), this.KATE_TOKEN) !== -1) {
$('.rowToken').removeClass('d-none');
$('.rowPulsa').addClass('d-none');
} else {
$('.rowToken').addClass('d-none');
$('.rowPulsa').removeClass('d-none');
}
new Request.JSONF({
url: this.PHP + '/option_operator',
sendParam: ['KateID'],
}).send();
},
oc_Tujuan: function(){
if ($('#Tujuan').val()=='') return false;
if ($.inArray(parseInt($('#KateID').val()), this.KATE_PREFIX) === -1) return false;
new Request.JSONF({
url: this.PHP + '/option_operator',
sendParam: ['KateID','Tujuan'],
}).send();
},
oc_OpeID: function(){
if ($('#OpeID').val()==0) return false;
new Request.JSONF({
url: this.PHP + '/option_produk',
sendParam: ['KateID','OpeID'],
}).send();
},
oc_ProdukID: function(){
const obj = $('#ProdukID');
var harga = $(obj).find(":selected").attr('olabel');
$('#Harga_Jual').val(harga);
}
};
+71
View File
@@ -0,0 +1,71 @@
/*******************************************************************
PHP Class : /Controller/Ppob/TopupController
Description : Transaksi Topup Saldo PPOB
Created By : Siau Pheng ([email protected]).
Created Date : October 6th, 2017.
Last Modified : September 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var TopupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('tabel-detail');
$('#butTambah').click(() => this.tx_tambah());
$('#Cari_Topup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-detail');
});
$('#butSearch').click(() => this.data_query('tabel-detail'));
$('#butAll').click(() => {
$('#Cari_Topup').val('');
this.data_query('tabel-detail');
});
FoniaJS.setFocus('#Cari_Topup');
},
tx_info: function(acell){
this.winInfo = FoniaJS.showWindow('', 'Informasi Topup Saldo', '<div class="form-control fs-4">'+acell[6]+'</div>', 'md');
},
tx_tambah: function(){
new Request({
url: this.PHP + '/form_topup',
onSuccess: (a) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Topup Saldo', a.html, 'md', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.tx_simpan()).end()
.find('#Jumlah').click(() => $('#Jumlah').select());
});
}
}).send();
},
tx_simpan: function(){
if (parseInt($('#Jumlah').val())==0) {
FoniaJS.showError('Silakan isi Jumlah lebih dari NOL !');
$('#Jumlah').focus();
return;
}
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=insert','Tgl_Depo','Jumlah','Bank'],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
},
data_query: function(tipe){
if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Topup']
}).send();
}
}
};
+170
View File
@@ -0,0 +1,170 @@
/*******************************************************************
PHP Class : /Controller/Promo/BarangController
Description : Konfigurasi Promo Penjualan Barang
Created By : Siau Pheng ([email protected]).
Created Date : September 28th, 2014.
Last Modified : September 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PromoBarangJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Promo').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Promo').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Promo');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_promo',
sendParam: ['mode_detail='+mode,'PromoID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Promo', ajson.html, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_save()).end()
.find('#butBrow1').click(() => this.produk_brow(1)).end()
.find('#butBrow2').click(() => this.produk_brow(2));
if ($.inArray($("#mode_detail").val(),['insert','update']) !== -1) {
this.update_Items($('#InvID').val(), $('#SatuanID').val(), 1);
this.update_Items($('#Promo_InvID').val(), $('#Promo_SatuanID').val(), 2);
this.oc_PilihQ();
this.oc_PilihP();
}
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['mode_detail','PromoID','InvID','SatuanID','CabID','Grup_MemberID','Pilih_Qty','Qty_Min','Qty_Kali','Tipe_Promo','Promo_Disc','Promo_InvID','Promo_SatuanID','Promo_Qty','Jumlah_Promo','Tgl_Mulai','Tgl_Akhir','Aktif','Cari_Promo'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
produk_brow: function(tipe){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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><input type="hidden" id="Tipe_Brow" value="'+tipe+'" /></div></div></div><div id="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'lg', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
FoniaJS.setFocus('#Cari_Produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
var itipe = parseInt($('#Tipe_Brow').val());
if (itipe == 1){
$('#InvID').val(acell[0]);
$('#Nama_Produk').val(acell[1]);
this.update_Items(acell[0], 0, 1);
} else {
$('#Promo_InvID').val(acell[0]);
$('#Promo_Produk').val(acell[1]);
this.update_Items(acell[0], 0, 2);
}
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['Cari_Promo']
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
update_Items: function(InvID, SatuanID, Tipe){
const elSatuan = (Tipe==1) ? $('#SatuanID') : $('#Promo_SatuanID');
elSatuan.empty();
if (InvID==0) return false;
new Request({
url: this.PHP + '/item_detail',
sendParam: ['InvID='+InvID],
onSuccess: (adata) => {
adata.map((val) => {
elSatuan.append(new Option(val['label'],val['value'],false,(val['value']==SatuanID?true:false)))
});
elSatuan.trigger('change');
}
}).send();
},
oc_PilihQ: function(){
var i = parseInt($('#Pilih_Qty').val());
if (i == 1){
$('#Qty_Min').prop('disabled', false);
$('#Qty_Kali').prop('disabled', true).val(0);
} else {
$('#Qty_Min').prop('disabled', true).val(0);
$('#Qty_Kali').prop('disabled', false);
}
},
oc_PilihP: function(){
var i = parseInt($('#Tipe_Promo').val());
if (i == 1){
$('.promo1').removeClass('d-none');
$('.promo2').addClass('d-none');
$('#Promo_SatuanID').val(0);
$('#Promo_Qty').val(0);
$('#Promo_InvID').val(0);
} else {
$('.promo1').addClass('d-none');
$('.promo2').removeClass('d-none');
$('#Promo_Disc').val(0);
}
}
};
+238
View File
@@ -0,0 +1,238 @@
/*******************************************************************
PHP Class : /Controller/Promo/BelidiscController
Description : Promo Beli & Diskon
Created By : Siau Pheng ([email protected]).
Created Date : September 28th, 2014.
Last Modified : October 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PromoBeliDiscJS = {
PHP: '',
KODE: '',
index: function(q){
$('#butTambah').click(() => this.promo_tambah());
$('#butUbah').click(() => this.promo_ubah());
$('#butHapus').click(() => this.promo_hapus());
$('#butSimpan').click(() => this.promo_simpan());
$('#butBatal').click(() => this.promo_batal());
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
},
promo_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Promo" 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="divBrowPromo">&nbsp;</div>');
this.winBPromo = FoniaJS.showWindow('BPromo', 'Daftar Promo', _isi, 'xl', '', () => {
$('#winBPromo')
.find('#Cari_Promo').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-promo');
}).end()
.find('#butSearch').click(() => this.data_query('brow-promo')).end()
.find('#butAll').click(() => {
$('#winBPromo').find('#Cari_Promo').val('');
this.data_query('brow-promo');
});
this.data_query('brow-promo');
});
},
promo_select: function(acell){
FoniaJS.closeWindow(this.winBPromo);
$('#Grup_PromoID').val(acell[0]);
this.data_query('master', 'view');
},
promo_tambah: function(){
this.data_query('master', 'add');
},
promo_ubah: function(){
if ($('#Grup_PromoID').val() == 0){
FoniaJS.showError("Silakan pilih Nama Promo !");
return;
}
this.data_query('master', 'edit');
},
promo_hapus: function(){
if ($('#Grup_PromoID').val() == 0){
FoniaJS.showError("Silakan pilih Nama Promo !");
return;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#Promo_Nama').val()+'</strong> ?', () => {
new Request({
url: this.PHP + '/proses_delete',
sendParam: ['Grup_PromoID'],
onSuccess: (ajson) => {
if (ajson.status === true){
$('#Grup_PromoID').val(0);
this.data_query('master', 'view');
FoniaJS.showInfo('Proses hapus data sukses!');
} else {
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
}
}
}).send();
}, 'danger');
},
promo_simpan: function(mode){
this.data_query('master', 'save');
},
promo_batal: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#Grup_PromoID').val(0);
}, 'danger');
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
this.detail_produk('insert', 0, acell[0], acell[1], '0');
},
detail_produk: function(mode, PromoID, InvID, SatuanID, Kode_Varian){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode','mode_detail='+mode,'Grup_PromoID','PromoID='+PromoID,'InvID='+InvID,'SatuanID='+SatuanID,'Kode_Varian='+Kode_Varian],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang Promo', ajson.html, 'lg', [{},{i:'butBatal'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
//select_all, clear_all
.find('#butWSimpan').click(() => this.detail_simpan());
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['Grup_PromoID'], {'selectFunc':this.Produk_Comp});
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
this.update_items(InvID, SatuanID);
FoniaJS.setFocus('#Nama_Produk');
});
}
}).send();
},
detail_tambah: function() {
this.detail_produk('insert', 0, 0, 0, '0');
},
detail_ubah: function(acell){
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail=delete','Grup_PromoID','PromoID='+acell[0]],
}).send();
}, 'danger');
},
detail_simpan: function(){
if ($('#InvID').val() == 0) {
FoniaJS.showError('Silakan masukkan Nama Barang Promo !');
return;
}
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','mode_detail','Grup_PromoID','PromoID','InvID','SatuanID','Kode_Varian'],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
},
varian_show: function(){
new Request.JSONF({
url: this.PHP + '/form_varian',
sendParam: ['InvID','SatuanID','Kode_Varian']
}).send();
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="master"){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'Grup_PromoID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
if (-1 !== mode.search(/save/i)) sparam = ['mode='+mode,'Grup_PromoID','CabID','Grup_MemberID','Qty_Kali','Tipe_Promo','Promo_Nama','Promo_Minggu','Promo_Disc','Tgl_Mulai','Tgl_Akhir','Aktif'];
new Request({
url: this.PHP + '/form_master',
sendParam: sparam,
onSuccess: (ajson) => {
$('#divTXMaster').html(ajson.html);
$('#butBrow').click(() => this.promo_brow());
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');
} 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 ($('#Grup_PromoID').val() == 0) {
$('#butUbah').prop('disabled', true);
$('#butHapus').prop('disabled', true);
}
}
}).send();
} else if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','Grup_PromoID']
}).send();
} else if (tipe=="brow-promo"){
new Request.JSONF({
url: this.PHP + '/brow_promo',
sendParam: ['Cari_Promo'],
onSuccess: () => FoniaJS.setFocus('#Cari_Promo')
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk','Grup_PromoID'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
$('#InvID').val(item.value);
$('#Nama_Produk').val(item.text);
PromoBeliDiscJS.update_items(item.value, item.data);
},
update_items: function(InvID, SatuanID){
new Request.JSONF({
url: this.PHP + '/option_satuan',
sendParam: ['InvID='+InvID,'SatuanID='+SatuanID],
onSuccess: () => this.varian_show()
}).send();
}
};
+182
View File
@@ -0,0 +1,182 @@
/*******************************************************************
PHP Class : /Controller/Promo/TotalController
Description : Promo Penjualan Total Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : September 28th, 2014.
Last Modified : September 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PromoTotalJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Promo').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Promo').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Promo');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_promo',
sendParam: ['mode_detail='+mode,'PromoID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Promo', ajson.html, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_save()).end()
.find('#butBrow1').click(() => this.grup_show()).end()
.find('#butBrow2').click(() => this.produk_brow());
if ($.inArray($("#mode_detail").val(),['insert','update']) !== -1) {
this.update_Items($('#Promo_InvID').val(), $('#Promo_SatuanID').val());
this.oc_PilihP();
}
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['mode_detail','PromoID','Nama_Promo','Jual_Min','Jual_Grup','CabID','Grup_MemberID','Tipe_Promo','Promo_Jual','Promo_InvID','Promo_SatuanID','Promo_Qty','Jumlah_Promo','Tgl_Mulai','Tgl_Akhir','Aktif','Cari_Promo'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
grup_show: function(){
new Request({
url: this.PHP + '/form_grup',
sendParam: ['Jual_Grup'],
onSuccess: (ajson) => {
this.winGrup = FoniaJS.showWindow('Grup', 'Daftar Grup Barang', ajson.html, 'lg', [{i:'butWSAll',v:'Cek Semua',c:'info'},{i:'butWCAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winGrup')
.find('#butWSAll').click(() => this.grup_semua()).end()
.find('#butWCAll').click(() => this.grup_clear()).end()
.find('#butWSimpan').click(() => this.grup_save());
});
}
}).send();
},
grup_semua: function(){
$('#tabGrupList input.form-check-input[type=checkbox]').prop('checked', true);
},
grup_clear: function(){
$('#tabGrupList input.form-check-input[type=checkbox]').prop('checked', false);
},
grup_save: function(){
var alist = [];
$('#tabGrupList tbody input.form-check-input[type=checkbox]:checked').map((i, b) => {
alist.push($(b).val());
});
$('#Jual_Grup').val(alist.join());
FoniaJS.closeWindow(this.winGrup);
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'lg', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
FoniaJS.setFocus('#Cari_Produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#Promo_InvID').val(acell[0]);
$('#Promo_Produk').val(acell[1]);
this.update_Items(acell[0], 0);
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_promo',
sendParam: ['Cari_Promo']
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
update_Items: function(InvID, SatuanID){
$('#Promo_SatuanID').empty();
if (InvID==0) return false;
new Request({
url: this.PHP + '/item_detail',
sendParam: ['InvID='+InvID],
onSuccess: (adata) => {
adata.map((val) => {
$('#Promo_SatuanID').append(new Option(val['label'],val['value'],false,(val['value']==SatuanID?true:false)))
});
$('#Promo_SatuanID').trigger('change');
}
}).send();
},
oc_PilihP: function(){
var i = parseInt($('#Tipe_Promo').val());
if (i == 4){
$('.promo1').removeClass('d-none');
$('.promo2').addClass('d-none');
$('#Promo_SatuanID').val(0);
$('#Promo_Qty').val(0);
$('#Promo_InvID').val(0);
$('#Jumlah_Promo').val(0);
} else {
$('.promo1').addClass('d-none');
$('.promo2').removeClass('d-none');
$('#Promo_Jual').val(0);
}
}
};
+45
View File
@@ -0,0 +1,45 @@
/*******************************************************************
PHP Class : /Controller/Report/Beli/AnalisaController
Description : Laporan Analisa Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : October 3rd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoBeliAnalisaJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Grup_InvID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Grup_InvID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+45
View File
@@ -0,0 +1,45 @@
/*******************************************************************
PHP Class : /Controller/Report/Beli/BeliController
Description : Laporan Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : September 30th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoBeliJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Grup_InvID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Grup_InvID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+51
View File
@@ -0,0 +1,51 @@
/*******************************************************************
PHP Class : /Controller/Report/Beli/MutasiController
Description : Laporan Mutasi Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : April 3rd, 2013.
Last Modified : October 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoBeliMutasiJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
$('#SupID').focus();
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
$('#SupID').focus();
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+43
View File
@@ -0,0 +1,43 @@
/*******************************************************************
PHP Class : /Controller/Report/Beli/ReturController
Description : Laporan Retur Pembelian
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : October 2nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoBeliReturJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Dana/KeluarController
Description : Laporan Pengeluaran Dana
Created By : Siau Pheng ([email protected]).
Created Date : May 18th, 2012.
Last Modified : October 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoDanaKeluarJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Dana/MasukController
Description : Laporan Penerimaan Dana
Created By : Siau Pheng ([email protected]).
Created Date : May 18th, 2012.
Last Modified : October 10th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoDanaMasukJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+59
View File
@@ -0,0 +1,59 @@
/*******************************************************************
PHP Class : /Controller/Report/Dana/PosController
Description : Laporan Penerimaan Dana POS / Kasir
Created By : Siau Pheng ([email protected]).
Created Date : September 8th, 2012.
Last Modified : October 9th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoDanaPosJS = {
PHP: '',
KODE: '',
index: function(){
$('#butPOS').click(() => this.proses_pos());
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_pos: function(){
if ($('#KasirID').val()==0){
FoniaJS.showError("Untuk Cetak POS, pilih satu Nama Kasir !");
$('#KasirID').focus();
return;
}
var cetak = new PrinterPos(this.PHP + '/pos');
cetak.add_param("Tipe", "R");
cetak.add_param("CabID");
cetak.add_param("KasirID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
cetak.exec();
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("KasirID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("KasirID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/BulanneracaController
Description : Laporan Neraca Bulanan
Created By : Siau Pheng ([email protected]).
Created Date : July 8th, 2008.
Last Modified : October 24th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelBNeracaJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("Bulan");
cetak.add_param("Tahun");
cetak.add_param("Level");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("Bulan");
dload.add_param("Tahun");
dload.add_param("Level");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/BulanrlcabController
Description : Laporan Rugi / Laba Cabang
Created By : Siau Pheng ([email protected]).
Created Date : July 12th, 2008.
Last Modified : October 24th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelBRLCabJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Bulan1");
cetak.add_param("Bulan2");
cetak.add_param("Tahun");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Bulan1");
dload.add_param("Bulan2");
dload.add_param("Tahun");
dload.download();
}
};
+39
View File
@@ -0,0 +1,39 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/BulansaldoController
Description : Laporan Neraca Saldo Bulanan
Created By : Siau Pheng ([email protected]).
Created Date : July 12th, 2008.
Last Modified : October 24th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelBSaldoJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("Bulan");
cetak.add_param("Tahun");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("Bulan");
dload.add_param("Tahun");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/BulanshuController
Description : Laporan SHU Bulanan
Created By : Siau Pheng ([email protected]).
Created Date : July 12th, 2008.
Last Modified : October 24th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelBSHUJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Bulan1");
cetak.add_param("Bulan2");
cetak.add_param("Tahun");
cetak.add_param("Level");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Bulan1");
dload.add_param("Bulan2");
dload.add_param("Tahun");
dload.add_param("Level");
dload.download();
}
};
+39
View File
@@ -0,0 +1,39 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/HarianbantuController
Description : Laporan Buku Pembantu Harian
Created By : Siau Pheng ([email protected]).
Created Date : July 2nd, 2009.
Last Modified : October 22nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelHBantuJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Kode_Rek");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Kode_Rek");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+91
View File
@@ -0,0 +1,91 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/HarianbesarController
Description : Laporan Buku Besar Harian
Created By : Siau Pheng ([email protected]).
Created Date : May 1st, 2009.
Last Modified : October 22nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelHBesarJS = {
PHP: '',
KODE: '',
index: function(){
$('#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: function(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: function(){
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: function(){
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">&nbsp;</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');
});
},
rek_select: function(acell){
FoniaJS.closeWindow(this.winBRek);
$('#Kode_Rek').val(acell[0]);
$('#Nama_Rek').val(acell[1]);
$('#Tgl_From').focus();
},
data_query: function(tipe, mode){
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);
$('#Tgl_From').focus();
}
};
+67
View File
@@ -0,0 +1,67 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/HariandetailController
Description : Laporan Jurnal Detail
Created By : Siau Pheng ([email protected]).
Created Date : June 5th, 2009.
Last Modified : October 24th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelHDetailJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butBrowJurnal').click(() => this.jurnal_brow());
$('#Kode_Jurnal').keyup((e) => {
if ((e.which || e.keyCode) == 13) {
if (($("#Kode_Jurnal")) && ($("#Kode_Jurnal").val() !== '')) this.proses_print();
}
});
FoniaJS.setFocus('#Kode_Jurnal');
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Kode_Jurnal");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
jurnal_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Jurnal" 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="divBrowJurnal">&nbsp;</div>');
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
$('#winBTX')
.find('#Cari_Jurnal').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-jurnal');
}).end()
.find('#butSearch').click(() => this.data_query('brow-jurnal')).end()
.find('#butAll').click(() => {
$('#winBTX').find('#Cari_Jurnal').val('');
this.data_query('brow-jurnal');
});
this.data_query('brow-jurnal');
});
},
jurnal_select: function(acell){
FoniaJS.closeWindow(this.winBTX);
$('#Kode_Jurnal').val(acell[0]);
},
data_query: function(tipe, mode){
if (tipe=="brow-jurnal"){
new Request.JSONF({
url: this.PHP + '/brow_jurnal',
sendParam: ['Cari_Jurnal'],
onSuccess: () => FoniaJS.setFocus('#Cari_Jurnal')
}).send();
}
}
};
+39
View File
@@ -0,0 +1,39 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/HarianjurnalController
Description : Laporan Jurnal Harian
Created By : Siau Pheng ([email protected]).
Created Date : December 16th, 2008.
Last Modified : October 22nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelHJurnalJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("TipeID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("TipeID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+37
View File
@@ -0,0 +1,37 @@
/*******************************************************************
PHP Class : /Controller/Report/Gel/HariansaldoController
Description : Laporan Rekap Saldo Harian
Created By : Siau Pheng ([email protected]).
Created Date : December 16th, 2008.
Last Modified : October 22nd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoGelHSaldoJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+101
View File
@@ -0,0 +1,101 @@
/*******************************************************************
PHP Class : /Controller/Report/Inv/BarcodeController
Description : Laporan Barcode Barang
Created By : Siau Pheng ([email protected]).
Created Date : October 28th, 2013.
Last Modified : October 14th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoInvBarcodeJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print());
$('#butLoadPrinter').click(() => this.load_printer());
$('#butBrowProduk').click(() => this.produk_brow());
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc':this.Produk_Comp});
FoniaJS.setFocus('#Nama_Produk');
},
proses_print: function(){
if ($('#InvID').val() == 0){
FoniaJS.showError('Silakan masukkan Nama Barang !');
FoniaJS.setFocus('Nama_Produk');
return;
}
if ($('#Printer').val() == ''){
FoniaJS.showError('Silakan pilih Nama Printer Barcode !');
return;
}
var cetak = new PrinterPos(this.PHP + '/barcode');
cetak.setPrinter($('#Printer').val());
cetak.add_param("InvID");
cetak.add_param("SatuanID");
cetak.add_param("VarianID");
cetak.add_param("Qty");
cetak.add_param("Printer");
cetak.exec();
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#InvID').val(acell[0]);
$('#SatuanID').val(acell[1]);
$('#VarianID').val(acell[2]);
$('#Kode_SKU').val(acell[3]);
$('#Nama_Produk').val(acell[5]);
FoniaJS.setFocus('#Qty');
},
data_query: function(tipe){
if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
$('#VarianID').val(adata[1]);
$('#Kode_SKU').val(adata[2]);
$('#Nama_Produk').val(item.text);
FoniaJS.setFocus('#Qty');
},
load_printer: function(){
qz.printers.find().then((data) => {
new Request.JSONF({
url: this.PHP + '/load_printer',
sendParam: ['Printer='+JSON.stringify(data),'DefPrint='+$('#configPrinter').html()]
}).send();
});
}
};
+43
View File
@@ -0,0 +1,43 @@
/*******************************************************************
PHP Class : /Controller/Report/Inv/HutangController
Description : Laporan Hutang Supplier
Created By : Siau Pheng ([email protected]).
Created Date : July 17th, 2011.
Last Modified : October 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoInvHutangJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+142
View File
@@ -0,0 +1,142 @@
/*******************************************************************
PHP Class : /Controller/Report/Inv/LabelController
Description : Cetak Label Harga
Created By : Siau Pheng ([email protected]).
Created Date : September 13th, 2014.
Last Modified : October 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoInvLabelJS = {
PHP: '',
KODE: '',
index: function(q){
$('#butHapus').click(() => this.proses_empty());
$('#butPrint').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
this.data_query('tabel-detail', 'empty', ((typeof(q)!=='undefined') ? q : ''));
},
proses_empty: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=empty']
}).send();
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
if (prt) cetak.doPrint(); else cetak.doPreview();
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winBProduk')
.find('#butWSimpan').click(() => this.produk_simpan()).end()
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_simpan: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=simpan-produk'],
onSuccess: () => FoniaJS.closeWindow(this.winBProduk)
}).send();
},
grup_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Grup" 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="divBrowGrup">&nbsp;</div>');
this.winBGrup = FoniaJS.showWindow('BGrup', 'Daftar Grup Barang', _isi, 'xl', '', () => {
$('#winBGrup')
.find('#Cari_Grup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-grup');
}).end()
.find('#butSearch').click(() => this.data_query('brow-grup')).end()
.find('#butAll').click(() => {
$('#winBGrup').find('#Cari_Grup').val('');
this.data_query('brow-grup');
});
this.data_query('brow-grup');
});
},
grup_select: function(acell){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=simpan-grup','Grup_InvID='+acell[0]],
onSuccess: () => FoniaJS.closeWindow(this.winBGrup)
}).send();
},
detail_ubah: function(acell){
new Request({
url: this.PHP + '/form_detail',
sendParam: ['mode_detail=update','ID='+acell[0]],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_simpan())
.find('#Nama_Produk').keyup((e) => {
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
});
FoniaJS.setFocus('#Nama_Produk');
}, false);
}
}).send();
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','ID='+acell[0]]
}).send();
}, 'danger');
},
detail_simpan: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=update','ID='+$('#ID').val(),'Nama_Produk='+encodeURIComponent($('#Nama_Produk').val())],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
},
data_query: function(tipe, mode, kd_tx){
if (tipe=="tabel-detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail='+mode,'No_Label'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
} else if (tipe=="brow-grup"){
new Request.JSONF({
url: this.PHP + '/brow_grup',
sendParam: ['Cari_Grup'],
onSuccess: () => FoniaJS.setFocus('#Cari_Grup')
}).send();
}
}
};
+82
View File
@@ -0,0 +1,82 @@
/*******************************************************************
PHP Class : /Controller/Report/Inv/PiutangController
Description : Laporan Piutang Member
Created By : Siau Pheng ([email protected]).
Created Date : July 17th, 2011.
Last Modified : October 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoInvPiutangJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
}
};
+90
View File
@@ -0,0 +1,90 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/AnalisaController
Description : Laporan Analisa Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : May 9th, 2013.
Last Modified : October 5th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualAnalisaJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Grup_InvID");
cetak.add_param("Grup_MemberID");
cetak.add_param("MemberID");
cetak.add_param("SupID");
cetak.add_param("Urut");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Grup_InvID");
dload.add_param("Grup_MemberID");
dload.add_param("MemberID");
dload.add_param("SupID");
dload.add_param("Urut");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
}
};
+43
View File
@@ -0,0 +1,43 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/JualController
Description : Laporan Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : October 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+84
View File
@@ -0,0 +1,84 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/MarginController
Description : Laporan Margin Penjualan / Member
Created By : Siau Pheng ([email protected]).
Created Date : October 12nd, 2012.
Last Modified : October 7th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualMarginJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("MemberID");
cetak.add_param("Urut");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("MemberID");
dload.add_param("Urut");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/MarginposController
Description : Laporan Margin Penjualan / POS
Created By : Siau Pheng ([email protected]).
Created Date : October 12nd, 2012.
Last Modified : October 7th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualMarginPosJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+91
View File
@@ -0,0 +1,91 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/MutasiController
Description : Laporan Mutasi Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : April 3rd, 2013.
Last Modified : October 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualMutasiJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
FoniaJS.setFocus('#Nama_Member');
},
proses_print: function(prt){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
$('#Nama_Member').focus();
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
$('#Nama_Member').focus();
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
}
};
+138
View File
@@ -0,0 +1,138 @@
/*******************************************************************
PHP Class : /Controller/Report/Jual/RekapController
Description : Laporan Rekap Penjualan
Created By : Siau Pheng ([email protected]).
Created Date : July 16th, 2011.
Last Modified : October 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoJualRekapJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowProduk').click(() => this.produk_brow());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc':this.Produk_Comp});
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
FoniaJS.setFocus('#Nama_Produk');
},
proses_print: function(prt){
if ($('#InvID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Barang !");
$('#Nama_Produk').focus();
return;
}
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
$('#Nama_Member').focus();
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("InvID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#InvID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Barang !");
$('#Nama_Produk').focus();
return;
}
if ($('#MemberID').val()==0){
FoniaJS.showError("Silakan masukkan Nama Member !");
$('#Nama_Member').focus();
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("InvID");
dload.add_param("MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#InvID').val(acell[0]);
$('#Nama_Produk').val(acell[5]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
},
Produk_Comp: function(item){
$('#InvID').val(item.value);
}
};
+100
View File
@@ -0,0 +1,100 @@
/*******************************************************************
PHP Class : /Controller/Report/Member/HistoriController
Description : Laporan Sejarah Point Member
Created By : Siau Pheng ([email protected]).
Created Date : May 9th, 2017.
Last Modified : October 17th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoMemberHistoriJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowMember').click(() => this.member_brow());
FoniaJS.AutoComplete('#Nama_Member', this.PHP + '/auto_member', [], {'selectFunc':this.Member_Comp});
},
proses_print: function(prt){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
if ($('#MemberID').val() == 0){
FoniaJS.showInfo("Silakan masukkan Nama Member !");
FoniaJS.setFocus('#Nama_Member');
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Point_TipeID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
if ($('#MemberID').val() == 0){
FoniaJS.showInfo("Silakan masukkan Nama Member !");
FoniaJS.setFocus('#Nama_Member');
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Point_TipeID");
dload.add_param("MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
member_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Member" 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="divBrowMember">&nbsp;</div>');
this.winBMember = FoniaJS.showWindow('BMember', 'Daftar Member', _isi, 'xl', '', () => {
$('#winBMember')
.find('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-member');
}).end()
.find('#butSearch').click(() => this.data_query('brow-member')).end()
.find('#butAll').click(() => {
$('#winBMember').find('#Cari_Member').val('');
this.data_query('brow-member');
});
this.data_query('brow-member');
});
},
member_select: function(acell){
FoniaJS.closeWindow(this.winBMember);
$('#MemberID').val(acell[0]);
$('#Nama_Member').val(acell[1]);
},
data_query: function(tipe){
if (tipe=="brow-member"){
new Request.JSONF({
url: this.PHP + '/brow_member',
sendParam: ['Cari_Member'],
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
}).send();
}
},
Member_Comp: function(item){
$('#MemberID').val(item.value);
}
};
+53
View File
@@ -0,0 +1,53 @@
/*******************************************************************
PHP Class : /Controller/Report/Member/PointController
Description : Laporan Point Member
Created By : Siau Pheng ([email protected]).
Created Date : May 9th, 2017.
Last Modified : October 17th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoMemberPointJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Point_TipeID");
cetak.add_param("Grup_MemberID");
cetak.add_param("Urut");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Point_TipeID");
dload.add_param("Grup_MemberID");
dload.add_param("Urut");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+51
View File
@@ -0,0 +1,51 @@
/*******************************************************************
PHP Class : /Controller/Report/Member/TukarController
Description : Laporan Penukaran Barang
Created By : Siau Pheng ([email protected]).
Created Date : May 9th, 2017.
Last Modified : October 18th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoMemberTukarJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Point_TipeID");
cetak.add_param("Grup_MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#Point_TipeID').val() == 0){
FoniaJS.showInfo("Silakan pilih Tipe Point !");
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Point_TipeID");
dload.add_param("Grup_MemberID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Ppob/JualController
Description : Laporan Penjualan PPOB
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : October 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoPPOBJualJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Ppob/MarginController
Description : Laporan Margin Penjualan PPOB
Created By : Siau Pheng ([email protected]).
Created Date : April 12th, 2011.
Last Modified : October 8th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoPPOBMarginJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Tipe");
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+39
View File
@@ -0,0 +1,39 @@
/*******************************************************************
PHP Class : /Controller/Report/Rekap/MarginController
Description : Laporan Rekap Margin Harian
Created By : Siau Pheng ([email protected]).
Created Date : January 19th, 2013.
Last Modified : October 10th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoRekapMarginJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+39
View File
@@ -0,0 +1,39 @@
/*******************************************************************
PHP Class : /Controller/Report/Rekap/ModalController
Description : Laporan Rekap Modal Harian
Created By : Siau Pheng ([email protected]).
Created Date : January 19th, 2013.
Last Modified : October 10th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoRekapModalJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+72
View File
@@ -0,0 +1,72 @@
/*******************************************************************
PHP Class : /Controller/Report/Stok/AkhirController
Description : Laporan Stok Akhir Barang
Created By : Siau Pheng ([email protected]).
Created Date : January 24th, 2011.
Last Modified : October 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoStokAkhirJS = {
PHP: '',
KODE: '',
index: function(){
$('#butPOS').click(() => this.proses_pos());
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_pos: function(){
var cetak = new PrinterPos(this.PHP + '/pos');
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Grup_InvID");
cetak.add_param("PPN");
cetak.add_param("Tanggal");
cetak.add_param("Urut");
cetak.add_param("Min_Stok");
cetak.add_param("Min_Qty");
cetak.exec();
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Grup_InvID");
cetak.add_param("PPN");
cetak.add_param("Tanggal");
cetak.add_param("Urut");
cetak.add_param("Min_Stok");
cetak.add_param("Min_Qty");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("SupID");
dload.add_param("Grup_InvID");
dload.add_param("PPN");
dload.add_param("Tanggal");
dload.add_param("Urut");
dload.add_param("Min_Stok");
dload.add_param("Min_Qty");
dload.download();
},
oc_MinStok: function(){
if ($('#Min_Stok').val()=='Y') {
$('#Min_Qty').prop({disabled:false, readonly:false});
FoniaJS.setFocus('#Min_Qty')
} else {
$('#Min_Qty').prop({disabled:true, readonly:true}).val(0);
}
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Stok/CabangController
Description : Laporan Stok Barang per Cabang
Created By : Siau Pheng ([email protected]).
Created Date : July 16th, 2011.
Last Modified : October 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoStokCabangJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Cab1ID");
cetak.add_param("Cab2ID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("Cab1ID");
dload.add_param("Cab2ID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+92
View File
@@ -0,0 +1,92 @@
/*******************************************************************
PHP Class : /Controller/Report/Stok/MutasiController
Description : Laporan Mutasi Stok Barang
Created By : Siau Pheng ([email protected]).
Created Date : July 16th, 2011.
Last Modified : October 12th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoStokMutasiJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
$('#butBrowProduk').click(() => this.produk_brow());
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', [], {'selectFunc':this.Produk_Comp});
FoniaJS.setFocus('#Nama_Produk');
},
proses_print: function(prt){
if ($('#InvID').val()==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
$('#Nama_Produk').focus();
return;
}
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("InvID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
if ($('#InvID').val()==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
$('#Nama_Produk').focus();
return;
}
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("InvID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
},
produk_brow: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk')
.find('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key == 13 && e.target.value != '') this.data_query('brow-produk');
}).end()
.find('#butSearch').click(() => this.data_query('brow-produk')).end()
.find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
$('#InvID').val(acell[0]);
$('#Nama_Produk').val(acell[5]);
},
data_query: function(tipe){
if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
}).send();
}
},
Produk_Comp: function(item){
$('#InvID').val(item.value);
$('#Tgl_From').focus();
}
};
+41
View File
@@ -0,0 +1,41 @@
/*******************************************************************
PHP Class : /Controller/Report/Stok/OpnameController
Description : Laporan Stok Opname Barang
Created By : Siau Pheng ([email protected]).
Created Date : March 2nd, 2014.
Last Modified : October 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoStokOpnameJS = {
PHP: '',
KODE: '',
index: function(){
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_print: function(prt){
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("CabID");
cetak.add_param("Grup_InvID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload: function(){
var dload = new Download(this.PHP + '/excel');
dload.add_param("CabID");
dload.add_param("Grup_InvID");
dload.add_param("Tgl_From");
dload.add_param("Tgl_To");
dload.download();
}
};
+104
View File
@@ -0,0 +1,104 @@
/*******************************************************************
PHP Class : /Controller/System/AboutController
Description : Informasi Aplikasi
Created By : Siau Pheng ([email protected]).
Created Date : November 23th, 2011.
Last Modified : August 13th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var AboutJS = {
PHP: '',
KODE: '',
index: function(){
$('#win'+this.KODE).find('#divBuildInfo').html('<p>Aplikasi dibuat dengan komponen :<br>- jQuery Version '+$().jquery+' <br>- Bootstrap Version '+$.fn.tooltip.Constructor.VERSION+' <br>- FoniaJS Version '+FoniaJS.version+' <br>- FoniaPHP Version '+FoniaJS.version+'</p>');
$('#butDBCek').click(() => this.db_check());
$('#butDBOpti').click(() => this.db_opti());
$('#butUpdateCek').click(() => this.update_check());
},
db_check: function(){
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.db_run(ajson.db_count));
}
}).send();
},
db_opti: function(){
new Request({
url: this.PHP + '/db_check',
onSuccess: (ajson) => {
this.winCheck = FoniaJS.showWindow('CekDB', 'Optimalisasi Database', ajson.html, 500, [{},{i:'butTutup'}], () => this.opti_run(ajson.db_count));
}
}).send();
},
update_check: function(){
new Request({
url: this.PHP + '/update_check',
onSuccess: (ajson) => {
var tomb = [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}];
if (ajson.is_update) tomb.pop();
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', ajson.html, 500, tomb, () => {
$('#winCekApp').find('#butWUpdate').click(() => this.update_run());
});
}
}).send();
},
db_run: function(db_count = 0){
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/db_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
opti_run: function(db_count = 0){
if (db_count === 0) return false;
var items = Array(db_count).fill(0).map((_, index) => index);
var $ul = $('#db-list').empty();
items.reduce((prev, curr) => {
return prev.then(() => {
return $.ajax({
url: this.PHP + '/opti_proses',
data: {'Nomor': curr},
dataType: 'json',
type: 'POST',
}).done((response) => {
$ul.append('<li>' + response.html + '</li>');
});
});
}, $.Deferred().resolve().promise());
},
update_run: function(){
new Request({
url: this.PHP + '/update_proses',
onSuccess: (adata) => {
if (adata.success==true) {
$('#spanStatus').html(adata.message);
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan refresh browser Anda!');
} else {
FoniaJS.showInfo('Aplikasi gagal di Update.');
}
}
}).send();
}
};
+55
View File
@@ -0,0 +1,55 @@
/*******************************************************************
PHP Class : /Controller/System/ChpasswdController
Description : Data Ubah Password
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2008.
Last Modified : August 9th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SYSChpasswdJS = {
PHP: '',
KODE: '',
index: function(){
$('#butSave').click(() => this.proses_save());
FoniaJS.setFocus('#LPass');
},
proses_save: function(){
if ($("#LPass").val()=="") {
FoniaJS.showInfo("Silakan masukkan password lama Anda!");
FoniaJS.setFocus("#LPass");
return false;
} else if ($("#BPass1").val()=="") {
FoniaJS.showInfo("Silakan masukkan password baru 1 Anda!");
FoniaJS.setFocus("#BPass1");
return false;
} else if ($("#BPass2").val()=="") {
FoniaJS.showInfo("Silakan masukkan password baru 2 Anda!");
FoniaJS.setFocus("#BPass2");
return false;
} else if ($("#BPass1").val()!=$("#BPass2").val()) {
FoniaJS.showInfo("Password baru 1 dan 2 Anda tidak sama!");
FoniaJS.setFocus("#BPass1");
return false;
}
new Request({
url: this.PHP + '/simpan',
sendParam: ['LPass','BPass1'],
onSuccess: (ajson) => {
if (ajson.status == true) {
FoniaJS.showInfo(ajson.message);
FoniaJS.closeWindow('#win'+this.KODE);
} else {
FoniaJS.showError(ajson.message);
}
}
}).send();
}
};
+59
View File
@@ -0,0 +1,59 @@
/*******************************************************************
PHP Class : /Controller/System/ConfigController
Description : Konfigurasi Informasi Perusahaan
Created By : Siau Pheng ([email protected]).
Created Date : May 25th, 2010.
Last Modified : August 14th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var ConfigJS = {
PHP: '',
KODE: '',
index: function(){
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('view');
},
proses_edit: function(){
this.data_query('edit');
},
proses_save: function(){
new Request({
url: this.PHP + '/config',
sendParam: ['mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_EMAIL','REG_OWNER','REG_NPWP'],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
}
}).send()
},
data_query: function(mode){
new Request({
url: this.PHP + '/config',
sendParam: ['mode='+mode],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
}
}).send()
},
update_event: function(){
if ($.inArray($('#mode').val(), ['edit']) !== -1) {
$("#butUbah").prop('disabled', true);
$("#butSimpan").prop('disabled', false);
} else {
$("#butUbah").prop('disabled', false);
$("#butSimpan").prop('disabled', true);
}
}
};
+129
View File
@@ -0,0 +1,129 @@
/*******************************************************************
PHP Class : /Controller/System/MenugrupController
Description : Grup Login Menu
Created By : Siau Pheng ([email protected]).
Created Date : August 8th, 2013.
Last Modified : August 19th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MenuGrupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query();
$('#Cari_Grup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query();
});
$('#butSearch').click((e) => this.data_query());
$('#butAll').click(() => {
$('#Cari_Grup').val('');
this.data_query();
});
FoniaJS.setFocus('#Cari_Grup');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/detail_grup',
sendParam: ['mode='+mode,'Grup_MenuID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Grup Menu', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('add', 0);
},
detail_ubah: function(acell){
this.detail_show('edit', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm("Konfirmasi", "Yakin akan hapus "+acell[1]+"?", function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode=del','Grup_MenuID='+acell[0],'Cari_Grup'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}.bind(this), 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode','Grup_MenuID','Nama_Grup','Ket','Aktif','Cari_Grup'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
menu_show: function(acell){
new Request({
url: this.PHP + '/detail_menu',
sendParam: ['Grup_MenuID='+acell[0]],
onSuccess: (ajson) => {
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', ajson.html, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winMenu')
.find('#butWSelAll').click(() => this.menu_ceksemua()).end()
.find('#butWClrAll').click(() => this.menu_hapussemua()).end()
.find('#butWSimpan').click(() => this.menu_simpan()).end()
.find('#tabMenuList input.form-check-input[class*=cek-modul][type=checkbox]').each((i, el) => {
const elm = $(el);
elm.on('change', () => {
$('#tabMenuList tbody input.form-check-input[class*='+elm.attr('omodul')+'][type=checkbox]').map((i, b) => {
$(b).prop('checked', elm.is(':checked'));
});
});
});
});
}
}).send();
},
menu_ceksemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', true);
},
menu_hapussemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]').prop('checked', false);
},
menu_simpan: function(){
var alist = [];
$('#tabMenuList tbody input.form-check-input[type=checkbox]:checked').map((i, b) => {
alist.push($(b).val());
});
new Request({
url: this.PHP + '/save_menu',
sendParam: ['Grup_MenuID','Menu='+alist],
onSuccess: (ajson) => {
if (ajson.status==true){
FoniaJS.showInfo('Proses simpan data sukses!');
}else{
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
FoniaJS.closeWindow(this.winMenu);
}
}).send();
},
data_query: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Grup'],
}).send()
}
};
+187
View File
@@ -0,0 +1,187 @@
/*******************************************************************
PHP Class : /Controller/System/OperatorController
Description : Data Pengguna
Created By : Siau Pheng ([email protected]).
Created Date : August 1st, 2008.
Last Modified : August 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var OperatorJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_User').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_User').val('');
this.data_query('detail');
});
$('#butFilter').click(() => this.filter_show());
FoniaJS.setFocus('#Cari_User');
},
filter_show: function(){
new Request({
url: this.PHP + '/detail_filter',
sendParam: ['Filter_Level'],
onSuccess: (ajson) => {
this.winFilter = FoniaJS.showWindow('FLevel', 'Filter Data Pengguna / Level', ajson.html, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winFLevel')
.find('#butWSimpan').click(() => this.filter_simpan()).end()
.find('#Fi_Level').focus();
});
}
}).send();
},
filter_simpan: function(){
$('#Filter_Level').val($('#Fi_Level').val());
FoniaJS.closeWindow(this.winFilter);
this.data_query('detail');
},
detail_show: function(mode, UserID){
new Request({
url: this.PHP + '/detail_user',
sendParam: ['mode='+mode,'UserID='+UserID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Pengguna', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_check());
this.oc_Level();
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('add', 0);
},
detail_ubah: function(acell){
this.detail_show('edit', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm("Konfirmasi", "Yakin akan hapus ["+acell[1]+"] "+acell[2]+"?", () => {
new Request({
url: this.PHP + '/save_user',
sendParam: ['mode=del','UserID='+acell[0]],
onSuccess: (adata) => {
if (adata.status==true){
this.data_query('detail');
FoniaJS.showInfo('Proses hapus data sukses!');
}else{
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
}
}
}).send();
}, 'danger');
},
detail_check: function(){
if ($('#Username').val().toUpperCase()==$('#UserLama').val().toUpperCase()) {
this.detail_save();
return;
}
new Request({
url: this.PHP + '/check_user',
sendParam: ['Username'],
onSuccess: (adata) => {
if (adata.ada==true) {
FoniaJS.showInfo("Username telah ada dalam sistem !");
} else {
this.detail_save();
}
}
}).send();
},
detail_save: function(){
new Request({
url: this.PHP + '/save_user',
sendParam: ['mode','UserID','Username','Nama','Posisi','Level','Password','Grup_MenuID','Aktif'],
onSuccess: (adata) => {
if (adata.status==true){
this.data_query('detail');
FoniaJS.showInfo('Proses simpan data sukses!');
}else{
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
menu_show: function(acell){
new Request({
url: this.PHP + '/detail_menu',
sendParam: ['UserID='+acell[0]],
onSuccess: (ajson) => {
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', ajson.html, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winMenu')
.find('#butWSelAll').click(() => this.menu_ceksemua()).end()
.find('#butWClrAll').click(() => this.menu_hapussemua()).end()
.find('#butWSimpan').click(() => this.menu_simpan()).end()
.find('#tabMenuList thead input[type="checkbox"]:disabled').prop('indeterminate', true).end()
.find('#tabMenuList input.form-check-input[class*=cek-modul][type=checkbox]').each((i, el) => {
const elm = $(el);
elm.on('change', () => {
$('#tabMenuList tbody input.form-check-input[class*='+elm.attr('omodul')+'][type=checkbox]').map((i, b) => {
$(b).prop('checked', elm.is(':checked'));
});
});
});
});
}
}).send();
},
menu_ceksemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]:not(:disabled)').prop('checked', true);
},
menu_hapussemua: function(){
$('#tabMenuList input.form-check-input[type=checkbox]:not(:disabled)').prop('checked', false);
},
menu_simpan: function(){
var alist = [];
$('#tabMenuList tbody input.form-check-input[type=checkbox]:not(:disabled):checked').map((i, b) => {
alist.push($(b).val());
});
new Request({
url: this.PHP + '/save_menu',
sendParam: ['UserID','Menu='+alist],
onSuccess: (adata) => {
if (adata.status==true){
FoniaJS.showInfo('Proses simpan data sukses!');
}else{
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
FoniaJS.closeWindow(this.winMenu);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Filter_Level','Cari_User']
}).send()
}
},
oc_Level: function(){
}
};
+73
View File
@@ -0,0 +1,73 @@
/*******************************************************************
PHP Class : /Controller/System/PrinterController
Description : Printer POS
Created By : Siau Pheng ([email protected]).
Created Date : August 4th, 2013.
Last Modified : October 12th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PrinterJS = {
PHP: '',
KODE: '',
index: function(){
$('#butBrow').click(() => this.cab_brow());
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('form-printer');
},
cab_brow: function(){
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', '<div id="divBrowCab">&nbsp;</div>', 'lg', '', () => this.data_query('brow-cabang'));
},
cab_select: function(acell){
FoniaJS.closeWindow(this.winBCab);
$('#REG_ID').val(acell[0]);
this.data_query('form-printer', 'view');
},
proses_edit: function(){
this.data_query('form-printer', 'edit');
},
proses_save: function(){
this.data_query('form-printer', 'save');
},
data_query: function(tipe, mode){
if (tipe === 'form-printer'){
new Request({
url: this.PHP + '/form_printer',
sendParam: ['mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_BEGIN','TITLE_END'],
onSuccess: (ajson) => {
$('#divPrinter').html(ajson.html);
$('#Nama_Cabang').val(ajson.Nama_Cab);
this.update_event();
if (ajson.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!');
}
}).send();
} else if (tipe=='brow-cabang'){
new Request.JSONF({
url: this.PHP + '/brow_cabang',
}).send();
}
},
update_event: function(){
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
$('#butBrow').prop('disabled', true);
$('#butUbah').prop('disabled', true);
$('#butSimpan').prop('disabled', false);
} else {
$('#butBrow').prop('disabled', false);
$('#butUbah').prop('disabled', false);
$('#butSimpan').prop('disabled', true);
}
}
};
+65
View File
@@ -0,0 +1,65 @@
/*******************************************************************
PHP Class : /Controller/System/ProfileController
Description : Profile Pengguna
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2008.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SYSProfileJS = {
PHP: '',
KODE: '',
index: function(){
$('#butSave').click(() => this.save_profile());
$('#win'+this.KODE).find('#FileGambar').off('change').change(() => {
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
fd.append('Gambar1', files);
$.ajax({
url: this.PHP + '/upload_picture',
type: 'post',
data: fd,
contentType: false,
processData: false,
success: (ares) => {
if (ares.result !== 0){
FoniaJS.showInfo('Sukses upload gambar profile !');
this.get_picture();
} else {
FoniaJS.showError(ares.message);
}
}
});
});
this.get_picture();
},
save_profile: function(){
new Request({
url: this.PHP + '/save_profile',
sendParam: ['Nama','Posisi','Email','HP'],
onSuccess: (ajson) => {
if (ajson.status == true) {
FoniaJS.showInfo('Sukses simpan profile!');
FoniaJS.closeWindow('#win'+this.KODE);
} else {
FoniaJS.showError('Ada masalah dalam simpan profile!');
}
}
}).send();
},
get_picture: function(){
new Request({
url: this.PHP + '/get_picture',
onSuccess: (ajson) => {
$('#imgPhoto').attr('src', ajson.src);
}
}).send();
}
};
+35
View File
@@ -0,0 +1,35 @@
/*******************************************************************
PHP Class : /Controller/System/SuperController
Description : Supervisi Operator
Created By : Siau Pheng ([email protected]).
Created Date : September 11st, 2012.
Last Modified : August 29th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SuperJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query();
if ($('#divSuper').length > 0 && socket.active) socket.emit('super-check');
},
detail_select: function(acell){
new Request({
url: this.PHP + '/approve',
sendParam: ['AuthID='+acell[0]],
onSuccess: () => this.data_query()
}).send();
},
data_query: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
}).send();
}
};
+60
View File
@@ -0,0 +1,60 @@
/*******************************************************************
PHP Class : /Controller/Table/Gel/GajiController
Description : Master Standar Gaji
Created By : Siau Pheng ([email protected]).
Created Date : September 17th, 2014.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var GajiJS = {
PHP: '',
KODE: '',
index: function(){
$('#butUbah').click(() => this.proses_edit());
$('#butSimpan').click(() => this.proses_save());
this.data_query('view');
},
proses_edit: function(){
this.data_query('update');
},
proses_save: function(){
new Request({
url: this.PHP + '/form_gaji',
sendParam: ['mode_detail=save','REG_ID','LEMBUR','BONUS1','BONUS2'],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
FoniaJS.showInfo('Data Standar Gaji Karyawan sukses disimpan!');
}
}).send()
},
data_query: function(mode){
new Request({
url: this.PHP + '/form_gaji',
sendParam: ['mode_detail='+mode,'REG_ID'],
onSuccess: (ajson) => {
$('#divMaster').html(ajson.html);
this.update_event();
}
}).send()
},
update_event: function(){
if ($.inArray($('#mode_detail').val(), ['update']) >= 0) {
$("#butUbah").prop('disabled', true);
$("#butSimpan").prop('disabled', false);
} else {
$("#butUbah").prop('disabled', false);
$("#butSimpan").prop('disabled', true);
}
}
};
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
PHP Class : /Controller/Table/Gel/GrupController
Description : Master Grup Rekening
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RekGrupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Rek').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Rek').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Rek');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_grup',
sendParam: ['mode_detail='+mode,'Grup_RekID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Grup Rekening', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','Grup_RekID='+acell[0],'Cari_Rek'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','Grup_RekID','Nama_Grup','Aktif','Cari_Rek'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Rek']
}).send();
}
}
};
+79
View File
@@ -0,0 +1,79 @@
/*******************************************************************
PHP Class : /Controller/Table/Gel/KaryawanController
Description : Master Karyawan
Created By : Siau Pheng ([email protected]).
Created Date : July 7th, 2015.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var KaryawanJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Karya').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Karya').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Karya');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_karya',
sendParam: ['mode_detail='+mode,'KaryaID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Data Karyawan', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => $('#winDetail').find('#butWSimpan').click(() => this.detail_save()));
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','KaryaID='+acell[0],'Cari_Karya'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','KaryaID','Nama_Karya','Gaji_Harian','Tgl_Masuk','Tgl_Keluar','Aktif','Cari_Karya'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Karya']
}).send();
}
}
};
+102
View File
@@ -0,0 +1,102 @@
/*******************************************************************
PHP Class : /Controller/Table/Gel/RekController
Description : Master Rekening
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RekJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#butPrint').click(() => this.print_show());
$('#Cari_Rek').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Rek').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Rek');
},
print_show: function(){
new Request({
url: this.PHP + '/detail_print',
onSuccess: (ajson) => {
this.winDPrint = FoniaJS.showWindow('DPrint', 'Cetak Daftar Rekening', ajson.html, 'lg', [{},{"i":"butWCetak","v":"Cetak","c":"info"},{"i":"butWPreview","v":"Pratinjau","c":"secondary"}], () => {
$('#winDPrint')
.find('#butWCetak').click(() => this.print_rek(true)).end()
.find('#butWPreview').click(() => this.print_rek());
});
}
}).send();
},
print_rek: function(prt){
var cetak = new Printer(this.PHP + '/print_rek');
cetak.add_param("Grup_RekID");
cetak.add_param("Level");
cetak.add_param("Tgl_Cetak");
if (prt) cetak.doPrint(); else cetak.doPreview();
FoniaJS.closeWindow(this.winDPrint);
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_rek',
sendParam: ['mode_detail='+mode,'Kode_Rek='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Rekening', ajson.html, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => $('#winDetail').find('#butWSimpan').click(() => this.detail_save()));
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','Kode_Rek='+acell[0],'Cari_Rek'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','Kode_Rek','Kode_Induk','Nama_Rek','Grup_RekID','Level','Mode','Kas_Rek','Aktif','Cari_Rek'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Rek']
}).send();
}
}
};
+102
View File
@@ -0,0 +1,102 @@
/*******************************************************************
PHP Class : /Controller/Table/Member/MemberController
Description : Master Member
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2010.
Last Modified : September 3rd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MemberJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#butPrint').click(() => this.print_show());
$('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Member').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Member');
},
print_show: function(){
new Request({
url: this.PHP + '/detail_print',
onSuccess: (ajson) => {
this.winDPrint = FoniaJS.showWindow('DPrint', 'Cetak Daftar Member', ajson.html, 'lg', [{},{"i":"butWCetak","v":"Cetak","c":"info"},{"i":"butWPreview","v":"Pratinjau","c":"secondary"}], () => {
$('#winDPrint')
.find('#butWCetak').click(() => this.print_member(true)).end()
.find('#butWPreview').click(() => this.print_member());
});
}
}).send();
},
print_member: function(prt){
var cetak = new Printer(this.PHP + '/print_member');
cetak.add_param("Grup_MemberID");
cetak.add_param("Aktif");
cetak.add_param("Tgl_Cetak");
if (prt) cetak.doPrint(); else cetak.doPreview();
FoniaJS.closeWindow(this.winDPrint);
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_member',
sendParam: ['mode_detail='+mode,'MemberID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Member', ajson.html, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => $('#winDetail').find('#butWSimpan').click(() => this.detail_save()));
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','MemberID='+acell[0],'Cari_Member'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','MemberID','Grup_MemberID','Kode_Member','Nama_Member','Alamat_Member','Kota_Member','Telp_Member','KTP_Member','Tgl_Lahir','Tgl_Daftar','IM','Aktif','Cari_Member'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Member']
}).send();
}
}
};
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
PHP Class : /Controller/Table/Member/MembergrupController
Description : Master Grup Member
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 3rd, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var MemberGrupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Member').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Member').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Member');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_grup',
sendParam: ['mode_detail='+mode,'Grup_MemberID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Grup Member', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','Grup_MemberID='+acell[0],'Cari_Member'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','Grup_MemberID','Kode_Grup','Nama_Grup','Aktif','Cari_Member'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Member']
}).send();
}
}
};
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
PHP Class : /Controller/Table/Member/PointbarangController
Description : Master Point Penukanan Barang
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PointBarangJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Barang').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Barang').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Barang');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_barang',
sendParam: ['mode_detail='+mode,'InvPID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Point Penukaran Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','InvPID='+acell[0],'Cari_Barang'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','InvPID','Point_TipeID','Nama_Barang','SatuanID','Nilai_Barang','Nilai_Point','Aktif','Cari_Barang'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Barang']
}).send();
}
}
};
+153
View File
@@ -0,0 +1,153 @@
/*******************************************************************
PHP Class : /Controller/Table/Member/PointskemaController
Description : Master Skema Point Member
Created By : Siau Pheng ([email protected]).
Created Date : September 28th, 2014.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PointSkemaJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Skema').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Skema').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Skema');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_skema',
sendParam: ['mode_detail='+mode,'PointID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Skema Point Member', ajson.html, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.detail_save()).end()
.find('#butBrow1').click(() => this.grup_form()).end()
.find('#butBrow2').click(() => this.barang_form());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[5]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','PointID='+acell[0],'Cari_Skema'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','PointID','Point_TipeID','KartuID','CabID','Grup_MemberID','Nilai_Jual','Grup_Barang','Kode_Barang','Tgl_Mulai','Aktif','Cari_Skema'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
grup_form: function(){
new Request({
url: this.PHP + '/form_grup',
sendParam: ['Grup_Barang'],
onSuccess: (ajson) => {
this.winGrup = FoniaJS.showWindow('Grup', 'Daftar Grup Barang', ajson.html, 'lg', [{i:'butWSAll',v:'Cek Semua',c:'info'},{i:'butWCAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winGrup')
.find('#butWSAll').click(() => this.grup_semua()).end()
.find('#butWCAll').click(() => this.grup_clear()).end()
.find('#butWSimpan').click(() => this.grup_save());
});
}
}).send();
},
grup_semua: function(){
$('#tabGrupList input.form-check-input[type=checkbox]').prop('checked', true);
},
grup_clear: function(){
$('#tabGrupList input.form-check-input[type=checkbox]').prop('checked', false);
},
grup_save: function(){
var alist = [];
$('#tabGrupList tbody input.form-check-input[type=checkbox]:checked').map((i, b) => {
alist.push($(b).val());
});
$('#Grup_Barang').val(alist.join());
FoniaJS.closeWindow(this.winGrup);
},
barang_form: function(){
new Request({
url: this.PHP + '/form_barang',
sendParam: ['Kode_Barang'],
onSuccess: (ajson) => {
this.winBarang = FoniaJS.showWindow('Barang', 'Daftar Barang', ajson.html, 'lg', null, () => {
FoniaJS.AutoComplete('#Nama_Produk', this.PHP + '/auto_produk', ['Kode_Barang'], {'selectFunc': this.Produk_Comp});
this.data_query("tabel-barang");
});
}
}).send();
},
barang_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_barang',
sendParam: ['mode_detail=delete','InvID='+acell[0],'Kode_Barang'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Skema']
}).send();
} else if (tipe=="tabel-barang"){
new Request.JSONF({
url: this.PHP + '/table_barang',
sendParam: ['Kode_Barang'],
onSuccess: () => FoniaJS.setFocus('#Nama_Produk')
}).send();
}
},
Produk_Comp: function(item){
new Request.JSONF({
url: PointSkemaJS.PHP + '/table_barang',
sendParam: ['mode_detail=insert','Kode_Barang','InvID='+item.value]
}).send();
$('#Nama_Produk').val('').focus();
}
};
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
PHP Class : /Controller/Table/Member/PointtipeController
Description : Master Tipe Point Member
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 4th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PointTipeJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Tipe').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Tipe').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Tipe');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_tipe',
sendParam: ['mode_detail='+mode,'Point_TipeID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Tipe Point Member', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','Point_TipeID='+acell[0],'Cari_Tipe'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','Point_TipeID','Nama_Tipe','Txt_Struk1','Txt_Struk2','Aktif','Cari_Tipe'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Tipe']
}).send();
}
}
};
+54
View File
@@ -0,0 +1,54 @@
/*******************************************************************
PHP Class : /Controller/Table/Ppob/KategoriController
Description : Master Kategori PPOB
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 1st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PPOBKateJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Kate').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Kate').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Kate');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_kategori',
sendParam: ['mode_detail='+mode,'KateID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Kategori PPOB', ajson.html, 'lg', [{},{i:'butTutup'}]);
}
}).send();
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Kate']
}).send();
}
}
};
+54
View File
@@ -0,0 +1,54 @@
/*******************************************************************
PHP Class : /Controller/Table/Ppob/OperatorController
Description : Master Operator PPOB
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 1st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PPOBOpeJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Ope').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Ope').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Ope');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_operator',
sendParam: ['mode_detail='+mode,'OpeID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Operator PPOB', ajson.html, 'lg', [{},{i:'butTutup'}]);
}
}).send();
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Ope']
}).send();
}
}
};
+115
View File
@@ -0,0 +1,115 @@
/*******************************************************************
PHP Class : /Controller/Table/Ppob/ProdukController
Description : Master Produk PPOB
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : September 1st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PPOBProdukJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('tabel-produk');
$('#butPrint').click(() => this.print_show());
$('#butUpdate').click(() => this.update_show());
$('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-produk');
});
$('#butSearch').click((e) => this.data_query('tabel-produk'));
$('#butAll').click(() => {
$('#Cari_Produk').val('');
this.data_query('tabel-produk');
});
FoniaJS.setFocus('#Cari_Produk');
},
print_show: function(){
new Request({
url: this.PHP + '/detail_print',
onSuccess: (ajson) => {
this.winDPrint = FoniaJS.showWindow('DPrint', 'Cetak Daftar Produk PPOB', ajson.html, 'lg', [{},{"i":"butWCetak","v":"Cetak","c":"info"},{"i":"butWPreview","v":"Pratinjau","c":"secondary"}], () => {
$('#winDPrint')
.find('#butWCetak').click(() => this.print_produk(true)).end()
.find('#butWPreview').click(() => this.print_produk());
});
}
}).send();
},
print_produk: function(prt){
var cetak = new Printer(this.PHP + '/print_produk');
cetak.add_param("KateID");
cetak.add_param("OpeID");
cetak.add_param("Tgl_Cetak");
if (prt) cetak.doPrint(); else cetak.doPreview();
FoniaJS.closeWindow(this.winDPrint);
},
update_show: function(){
new Request({
url: this.PHP + '/detail_update',
onSuccess: (ajson) => {
this.winDUpdate = FoniaJS.showWindow('DUpdate', 'Update Produk PPOB', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Proses',c:'success'}], () => {
$('#winDUpdate').find('#butWSimpan').click(() => this.update_proses());
});
}
}).send();
},
update_proses: function(){
new Request.JSONF({
url: this.PHP + '/proses_update',
sendParam: ['K_Kate','K_Ope'],
onSuccess: (ajson) => {
FoniaJS.closeWindow(this.winDUpdate);
this.data_query('tabel-produk');
}
}).send();
},
produk_show: function(mode, ID){
new Request({
url: this.PHP + '/form_produk',
sendParam: ['mode_detail='+mode,'ProdukID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Produk PPOB', ajson.html, 'xl', [{},{i:'butBatal'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.produk_simpan());
});
}
}).send();
},
produk_ubah: function(acell){
this.produk_show('update', acell[0]);
},
produk_simpan: function(){
new Request.JSONF({
url: this.PHP + '/table_produk',
sendParam: ['mode_detail','ProdukID','OpeID','KateID','Nama_Produk='+encodeURIComponent($('#Nama_Produk').val()),'Kode','Harga_Pokok','Harga_Jual','Status','Cari_Produk'],
onSuccess: (adata) => {
if (adata.status){
FoniaJS.showInfo('Proses simpan data sukses!');
} else FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="tabel-produk"){
new Request.JSONF({
url: this.PHP + '/table_produk',
sendParam: ['Cari_Produk']
}).send();
}
}
};
+519
View File
@@ -0,0 +1,519 @@
/*******************************************************************
PHP Class : /Controller/Table/ProdukController
Description : Master Barang
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : August 27th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var ProdukJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('tabel-produk');
$('#butPrint').click(() => this.print_show());
$('#butFilter').click(() => this.filter_show());
$('#Cari_Produk').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-produk');
});
$('#butSearch').click((e) => this.data_query('tabel-produk'));
$('#butAll').click(() => {
$('#Cari_Produk').val('');
this.data_query('tabel-produk');
});
FoniaJS.setFocus('#Cari_Produk');
},
print_show: function(){
new Request({
url: this.PHP + '/detail_print',
onSuccess: (ajson) => {
this.winDPrint = FoniaJS.showWindow('DPrint', 'Cetak Daftar Barang', ajson.html, 'lg', [{},{"i":"butWCetak","v":"Cetak","c":"info"},{"i":"butWPreview","v":"Pratinjau","c":"secondary"}], () => {
$('#winDPrint')
.find('#butWCetak').click(() => this.print_produk(true)).end()
.find('#butWPreview').click(() => this.print_produk());
});
}
}).send();
},
print_produk: function(prt){
var cetak = new Printer(this.PHP + '/print_barang');
cetak.add_param("SupID");
cetak.add_param("Grup_InvID");
cetak.add_param("Grup_MemberID");
cetak.add_param("Tgl_Cetak");
if (prt) cetak.doPrint(); else cetak.doPreview();
FoniaJS.closeWindow(this.winDPrint);
},
filter_show: function(){
new Request({
url: this.PHP + '/detail_filter',
sendParam: ['Filter_Produk'],
onSuccess: (ajson) => {
this.winFilter = FoniaJS.showWindow('Filter', 'Filter Produk Sesuai Grup', ajson.html, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winFilter').find('#butWSimpan').click(() => this.filter_simpan());
});
$('#Fi_Produk').focus();
}
}).send();
},
filter_simpan: function(){
$('#Filter_Produk').val($('#Fi_Produk').val());
FoniaJS.closeWindow(this.winFilter);
this.data_query('tabel-produk');
},
produk_show: function(mode, ID){
new Request({
url: this.PHP + '/detail_produk',
sendParam: ['mode='+mode,'InvID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'xl', [{},{i:'butWBtl',v:'Batal',c:'danger'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail')
.find('#butWSimpan').click(() => this.produk_simpan()).end()
.find('#butWBtl').click(() => this.produk_batal());
this.data_query('tabel-kemasan');
this.data_query('tabel-varian');
this.data_query('tabel-harga');
});
}
}).send();
},
produk_restore: function(acell){
new Request({
url: this.PHP + '/detail_restore',
sendParam: ['InvID='+acell[0]],
onSuccess: (ajson) => {
this.winBRest = FoniaJS.showWindow('BRest', 'Informasi Backup Barang', ajson.html, 'xl', [], () => this.data_query('tabel-restore'));
}
}).send();
},
produk_restore_select: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan restore data Barang ke versi tanggal : <b>"'+acell[0]+'"</b> ?<br><br><span class="text-danger fw-bold">HARAP KONFIRMASI KEMBALI, TERIMA KASIH!</span>', () => {
new Request({
url: this.PHP + '/proses_restore',
sendParam: ['InvID','MD5Key='+acell[1]],
onSuccess: (adata) => {
FoniaJS.showInfo('Sukses restore Data Barang ini!');
}
}).send();
}, 'danger');
},
produk_restore_form: function(acell, div){
new Request({
url: this.PHP + '/form_restore',
sendParam: ['InvID','MD5Key='+acell[1]],
onSuccess: (adata) => $(div).html(adata.html)
}).send();
},
produk_tambah: function(){
this.produk_show('add', 0);
},
produk_ubah: function(acell){
this.produk_show('edit', acell[0]);
},
produk_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
FoniaJS.showAuth(() => {
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['mode=del','InvID='+acell[0]],
onSuccess: (adata) => {
if (adata.status==true){
this.data_query('tabel-produk');
FoniaJS.showInfo('Proses hapus data sukses!');
} else {
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
}
}
}).send();
}, this, 'HAPUS BARANG : '+acell[1]);
}, 'danger');
},
produk_simpan: function(){
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['mode','InvID','Grup_InvID','Nama_Produk='+encodeURIComponent($('#Nama_Produk').val()),'StokID','NormalID','PPN','Harga_Beli','Harga_Tambah','Stok_Min','Stok_Max','Aktif'],
onSuccess: (adata) => {
if (adata.status==true){
this.data_query('tabel-produk');
FoniaJS.showInfo('Proses simpan data sukses!');
} else {
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
}
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
produk_batal: function(){
if ($('#mode').val()=='add'){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan batalkan Penambahan Barang ?', () => {
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['mode=cancel','InvID','mode_before=add'],
onSuccess: () => {
this.data_query('tabel-produk');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
}, 'danger');
return false;
}
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan batalkan Perubahan Detail Barang ?', () => {
new Request({
url: this.PHP + '/proses_simpan',
sendParam: ['mode=cancel','InvID'],
onSuccess: () => FoniaJS.closeWindow(this.winDetail)
}).send();
}, 'danger');
},
brow_produk: function(){
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Produk2" 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="divBrowProduk">&nbsp;</div>');
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 'xl', '', () => {
$('#winBProduk').find('#Cari_Produk2').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('brow-produk');
});
$('#winBProduk').find('#butSearch').click((e) => this.data_query('brow-produk'));
$('#winBProduk').find('#butAll').click(() => {
$('#winBProduk').find('#Cari_Produk2').val('');
this.data_query('brow-produk');
});
this.data_query('brow-produk');
FoniaJS.setFocus('#Cari_Produk2');
});
},
produk_select: function(acell){
FoniaJS.closeWindow(this.winBProduk);
new Request({
url: this.PHP + '/proses_copy',
sendParam: ['InvID','InvBaruID='+acell[0]],
onSuccess: (adata) => {
if (adata.status==true){
this.data_query('tabel-kemasan');
this.data_query('tabel-varian');
this.data_query('tabel-harga');
FoniaJS.showInfo('Salin data Kemasan & Harga dari barang lain telah selesai.');
}else{
FoniaJS.showInfo('Ada masalah dalam proses salin data!');
}
}
}).send();
},
kemasan_copy: function(){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan salin data dari barang lain ?<br><br><span class="text-danger fw-bold">KEMASAN & HARGA YANG ADA<br>SEKARANG AKAN DIHAPUS!</span>', () => this.brow_produk(), 'warning');
},
kemasan_batal: function(){
var dt = $('#divKemasanTabel').DataTable(), tr, l_row;
tr = $('#butBatalKemasan').closest('tr');
l_row = dt.row(tr.prev('tr'));
if (l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
if (l_row.data()[0]=='0') l_row.remove().draw(true);
},
kemasan_add: function(){
var dt = $('#divKemasanTabel').DataTable(), l_row;
dt.order([0,'desc']);
l_row = dt.row(':last');
if (!dt.data().count() || l_row.data()[0]!=='0'){
dt.row.add(['0','','','<a class="table-icon fon-tabel-dt" tabindex="-1" title="Detail"><i class="bi-pencil"></i></a>']).draw(true);
l_row = dt.row(':last');
}
if (!l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
},
kemasan_form: function(acell, div){
new Request({
url: this.PHP + '/form_kemasan',
sendParam: ['InvID','InvKemasanID='+acell[0],'Satuan_Stok='+$('#StokID').find(':selected').text()],
onSuccess: (adata) => {
$(div).html(adata.html);
$(div)
.find('#butBatalKemasan').click((e) => this.kemasan_batal()).end()
.find('#butSimpanKemasan').click((e) => this.kemasan_check());
}
}).send();
},
kemasan_del: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/tabel_kemasan',
sendParam: ['mode','mode_detail=delete','InvID','InvKemasanID='+acell[0],'SatuanLamaID='+acell[1],'Satuan_Stok='+$('#StokID').find(":selected").text()],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
var _obtn = $('button:contains("Salin Kemasan")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-warning');
}
}).send();
}, 'danger');
},
kemasan_save: function(){
if ($('#Qty').val()==0){
FoniaJS.showInfo('Mohon isi jumlah Qty / Kemasan !');
return false;
}
new Request.JSONF({
url: this.PHP + '/tabel_kemasan',
sendParam: ['mode','mode_detail=update','InvID','InvKemasanID','SatuanID','SatuanLamaID','Qty','Satuan_Stok='+$('#StokID').find(":selected").text()],
onSuccess: () => {
FoniaJS.showInfo('Sukses menyimpan kemasan produk.');
this.data_query('tabel-varian');
this.data_query('tabel-harga');
var _obtn = $('button:contains("Salin Kemasan")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-warning');
}
}).send();
},
kemasan_check: function(){
if ($('#SatuanID').val()==$('#SatuanLamaID').val()) {
this.kemasan_save();
return;
}
new Request({
url: this.PHP + '/check_kemasan',
sendParam: ['InvID','SatuanID'],
onSuccess: (adata) => {
if (adata.ada==true) {
FoniaJS.showInfo("Nama kemasan telah ada dalam sistem!");
} else {
this.kemasan_save();
}
}
}).send();
},
varian_batal: function(){
var dt = $('#divVarianTabel').DataTable(), tr, l_row;
tr = $('#butBatalVarian').closest('tr');
l_row = dt.row(tr.prev('tr'));
if (l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
if (l_row.data()[0]=='0') l_row.remove().draw(true);
},
varian_add: function(){
var dt = $('#divVarianTabel').DataTable(), l_row;
dt.order([0,'desc']);
l_row = dt.row(':last');
if (!dt.data().count() || l_row.data()[0]!=='0'){
dt.row.add(['0','SKU_BARU','','','','<a class="table-icon fon-tabel-dt" tabindex="-1" title="Detail"><i class="bi-pencil"></i></a>']).draw(true);
l_row = dt.row(':last');
}
if (!l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
},
varian_form: function(acell, div){
new Request({
url: this.PHP + '/form_varian',
sendParam: ['InvID','InvVarianID='+acell[0]],
onSuccess: (adata) => {
$(div).html(adata.html);
$(div)
.find('#butBatalVarian').click((e) => this.varian_batal()).end()
.find('#butSimpanVarian').click((e) => this.varian_check());
}
}).send();
},
varian_del: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[4]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/tabel_varian',
sendParam: ['mode','mode_detail=delete','InvID','InvVarianID='+acell[0]],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
varian_save: function(){
new Request.JSONF({
url: this.PHP + '/tabel_varian',
sendParam: ['mode','mode_detail=update','InvID','InvVarianID','SatuanID','VarianID','Kode_Barcode'],
onSuccess: () => FoniaJS.showInfo('Sukses menyimpan varian produk.')
}).send();
},
varian_check: function(){
if (($('#SatuanID').val()==$('#SatuanLamaID').val()) && ($('#VarianID').val()==$('#VarianLamaID').val()) && ($('#Kode_Barcode').val()==$('#Kode_BarcodeLama').val())) {
this.varian_save();
return;
}
new Request({
url: this.PHP + '/check_varian',
sendParam: ['InvID','SatuanID','VarianID','Kode_Barcode'],
onSuccess: (adata) => {
if (adata.ada==true) {
FoniaJS.showInfo("Nama varian telah ada dalam sistem!");
} else {
this.varian_save();
}
}
}).send();
},
harga_batal: function(){
var dt = $('#divHargaTabel').DataTable(), tr, l_row;
tr = $('#butBatalHarga').closest('tr');
l_row = dt.row(tr.prev('tr'));
if (l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
if (l_row.data()[0]=='0') l_row.remove().draw(true);
},
harga_add: function(){
var dt = $('#divHargaTabel').DataTable(), l_row;
dt.order([0,'desc']);
l_row = dt.row(':last');
if (!dt.data().count() || l_row.data()[0]!=='0'){
if (FoniaJS.user_level(2)) {
dt.row.add(['0','','',0,0,0,0,'<a class="table-icon fon-tabel-dt" tabindex="-1" title="Detail"><i class="bi-pencil"></i></a>']).draw(true);
} else dt.row.add(['0','','',0,'<a class="table-icon fon-tabel-dt" tabindex="-1" title="Detail"><i class="bi-pencil"></i></a>']).draw(true);
l_row = dt.row(':last');
}
if (!l_row.child.isShown()) l_row.nodes().to$().find('.fon-tabel-dt').click();
},
harga_form: function(acell, div){
new Request({
url: this.PHP + '/form_harga',
sendParam: ['InvID','InvHargaID='+acell[0]],
onSuccess: (adata) => {
$(div).html(adata.html);
$(div)
.find('#butBatalHarga').click((e) => this.harga_batal()).end()
.find('#butSimpanHarga').click((e) => this.harga_check());
this.calc_Modal();
this.calc_Harga(1);
}
}).send();
},
harga_del: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+' - '+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/tabel_harga',
sendParam: ['mode','mode_detail=delete','InvID','InvHargaID='+acell[0]],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
harga_save: function(){
new Request.JSONF({
url: this.PHP + '/tabel_harga',
sendParam: ['mode','mode_detail=update','InvID','InvHargaID','SatuanID','Grup_MemberID','Harga_Jual'],
onSuccess: () => FoniaJS.showInfo('Sukses menyimpan harga produk.')
}).send();
},
harga_check: function(){
if (($('#SatuanID').val()==$('#SatuanLamaID').val()) && ($('#Grup_MemberID').val()==$('#GrupLamaID').val())) {
this.harga_save();
return;
}
new Request({
url: this.PHP + '/check_harga',
sendParam: ['InvID','SatuanID','Grup_MemberID'],
onSuccess: (adata) => {
if (adata.ada==true) {
FoniaJS.showInfo("Harga jual per member telah ada dalam sistem!");
} else {
this.harga_save();
}
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="tabel-produk"){
new Request.JSONF({
url: this.PHP + '/tabel_produk',
sendParam: ['Cari_Produk','Filter_Produk']
}).send();
} else if (tipe=="tabel-kemasan"){
new Request.JSONF({
url: this.PHP + '/tabel_kemasan',
sendParam: ['mode','InvID','Satuan_Stok='+$('#StokID').find(":selected").text()],
onSuccess: () => {
var _obtn = $('button:contains("Salin Kemasan")');
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-warning');
}
}).send();
} else if (tipe=="tabel-varian"){
new Request.JSONF({
url: this.PHP + '/tabel_varian',
sendParam: ['mode','InvID']
}).send();
} else if (tipe=="tabel-harga"){
new Request.JSONF({
url: this.PHP + '/tabel_harga',
sendParam: ['mode','InvID']
}).send();
} else if (tipe=="tabel-restore"){
new Request.JSONF({
url: this.PHP + '/tabel_restore',
sendParam: ['InvID']
}).send();
} else if (tipe=="brow-produk"){
new Request.JSONF({
url: this.PHP + '/brow_produk',
sendParam: ['Cari_Produk2'],
onSuccess: () => FoniaJS.setFocus('#Cari_Produk2')
}).send();
}
},
hitung_HPP: function(){
$('#Harga_Pokok').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Beli').val()) + FoniaJS.StrToFloat($('#Harga_Tambah').val()), 0));
},
calc_Modal: function(){
new Request({
url: this.PHP + '/check_modal',
sendParam: ['InvID','SatuanID'],
onSuccess: (ajson) => {
if (ajson) {
$('#Harga_Modal').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Pokok').val()) * ajson.Qty));
this.calc_Harga(1);
}
}
}).send();
},
calc_Harga: function(tipe){
var harga = FoniaJS.StrToFloat($('#Harga_Jual').val());
var pjual = FoniaJS.StrToFloat($('#Persen_Jual').val());
var hmodal = FoniaJS.StrToFloat($('#Harga_Modal').val());
if (tipe == 1){
$('#Persen_Jual').val(FoniaJS.FloatToStr((harga == 0 ? 0 : (harga - hmodal) / harga * 100), 2));
} else {
$('#Harga_Jual').val(FoniaJS.FloatToStr(hmodal / (100 - pjual) * 100));
}
},
calc_Harga1: () => ProdukJS.calc_Harga(1),
calc_Harga2: () => ProdukJS.calc_Harga(2),
};
+81
View File
@@ -0,0 +1,81 @@
/*******************************************************************
PHP Class : /Controller/Table/ProdukgrupController
Description : Master Grup Barang
Created By : Siau Pheng ([email protected]).
Created Date : February 8th, 2011.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var ProdukGrupJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Grup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Grup').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Grup');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_grup',
sendParam: ['mode_detail='+mode,'Grup_InvID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Grup Barang', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','Grup_InvID='+acell[0],'Cari_Grup'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','Grup_InvID','Kode_Grup','Nama_Grup','Margin','Aktif','Cari_Grup'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Grup']
}).send();
}
}
};
+81
View File
@@ -0,0 +1,81 @@
/*******************************************************************
PHP Class : /Controller/Table/RekposController
Description : Master Jenis Pembayaran POS
Created By : Siau Pheng ([email protected]).
Created Date : September 9th, 2014.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RekPOSJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Rekpos').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Rekpos').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Rekpos');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_rekpos',
sendParam: ['mode_detail='+mode,'KartuID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jenis Pembayaran POS', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','KartuID='+acell[0],'Cari_Rekpos'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','KartuID','Kode_Kartu','Nama_Kartu','Kode_Rek','Aktif','Cari_Rekpos'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Rekpos']
}).send();
}
}
};
+83
View File
@@ -0,0 +1,83 @@
/*******************************************************************
PHP Class : /Controller/Table/SatuanController
Description : Master Satuan
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SatuanJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Satuan').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Satuan').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Satuan');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_satuan',
sendParam: ['mode_detail='+mode,'SatuanID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Satuan', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','SatuanID='+acell[0],'Cari_Satuan'],
onSuccess: () => {
FoniaJS.showInfo('Proses hapus data sukses!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','SatuanID','Kode_Satuan','Nama_Satuan','Aktif','Cari_Satuan'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Satuan']
}).send();
}
}
};
+85
View File
@@ -0,0 +1,85 @@
/*******************************************************************
PHP Class : /Controller/Table/SupplierController
Description : Master Supplier
Created By : Siau Pheng ([email protected]).
Created Date : December 7th, 2010.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var SupplierJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Sup').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click(() => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Sup').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Sup');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_supplier',
sendParam: ['mode_detail='+mode,'SupID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Supplier', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => $('#winDetail').find('#butWSimpan').click(() => this.detail_save()));
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[2]+'"</b> ?', () => {
new Request({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','SupID='+acell[0],'Cari_Sup'],
onSuccess: (adata) => {
if (adata.status==true){
FoniaJS.showInfo('Proses hapus data sukses!');
} else FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
}
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','SupID','Kode_Sup','Nama_Sup','Alamat_Sup','Telp_Sup','No_NPWP','No_NITKU','Aktif','Cari_Sup'],
onSuccess: (adata) => {
if (adata.status==true){
FoniaJS.showInfo('Proses simpan data sukses!');
} else FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Sup']
}).send();
}
}
};
+81
View File
@@ -0,0 +1,81 @@
/*******************************************************************
PHP Class : /Controller/Table/VarianController
Description : Master Varian
Created By : Siau Pheng ([email protected]).
Created Date : May 19th, 2010.
Last Modified : August 31st, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var VarianJS = {
PHP: '',
KODE: '',
index: function(){
this.data_query('detail');
$('#Cari_Varian').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('detail');
});
$('#butSearch').click((e) => this.data_query('detail'));
$('#butAll').click(() => {
$('#Cari_Varian').val('');
this.data_query('detail');
});
FoniaJS.setFocus('#Cari_Varian');
},
detail_show: function(mode, ID){
new Request({
url: this.PHP + '/form_varian',
sendParam: ['mode_detail='+mode,'VarianID='+ID],
onSuccess: (ajson) => {
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Varian', ajson.html, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], () => {
$('#winDetail').find('#butWSimpan').click(() => this.detail_save());
});
}
}).send();
},
detail_tambah: function(){
this.detail_show('insert', 0);
},
detail_ubah: function(acell){
this.detail_show('update', acell[0]);
},
detail_hapus: function(acell){
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', () => {
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail=delete','VarianID='+acell[0],'Cari_Varian'],
onSuccess: () => FoniaJS.showInfo('Proses hapus data sukses!')
}).send();
}, 'danger');
},
detail_save: function(){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['mode_detail','VarianID','Nama_Varian','Aktif','Cari_Varian'],
onSuccess: () => {
FoniaJS.showInfo('Proses simpan data sukses!');
FoniaJS.closeWindow(this.winDetail);
}
}).send();
},
data_query: function(tipe, mode){
if (tipe=="detail"){
new Request.JSONF({
url: this.PHP + '/table_detail',
sendParam: ['Cari_Varian']
}).send();
}
}
};