first commit
This commit is contained in:
@@ -0,0 +1,88 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/disp/config.js
|
||||
Desc. : JS - Konfigurasi Display POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : December 7th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butBrow').click(function(){this.cab_brow();}.bind(this));
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('form-display');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
var _isi = new String('<div id="divBrowCab"> </div>');
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', function(){
|
||||
this.data_query('brow-cabang');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=form-display','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: function(a){
|
||||
$('#divDisplay').html(a.html);
|
||||
$('#Nama_Cabang').val(a.Nama_Cabang);
|
||||
this.update_event();
|
||||
if (a.sukses) FoniaJS.showInfo('Konfigurasi display POS sukses disimpan!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=='brow-cabang'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-cabang']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butUbah').prop('disabled', true);
|
||||
$('#butSimpan').prop('disabled', false);
|
||||
} else {
|
||||
$('#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);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,107 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/disp/iklan.js
|
||||
Desc. : JS - Konfigurasi Display Iklan POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2015.
|
||||
Last Modified : December 8th, 2025.
|
||||
|
||||
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPIklanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Iklan').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Iklan').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Iklan');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: function(ajson){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Iklan', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_save();}.bind(this)).end()
|
||||
.find('#FileGambar').off('change').change(function(){
|
||||
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
|
||||
fd.append('Gambar1', files);
|
||||
$.ajax({
|
||||
url: this.PHP+'?'+(FoniaJS.RequestParam(['data=upload-gambar','PromoID']).join('&')),
|
||||
type: 'post',
|
||||
data: fd,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(ares){
|
||||
if (ares.result != 0){
|
||||
FoniaJS.showInfo('Sukses upload file Gambar !');
|
||||
$('#PromoID').val(ares.PromoID);
|
||||
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + ares.PromoID + '&cq=' + $.now());
|
||||
} else {
|
||||
FoniaJS.showError(ares.message);
|
||||
}
|
||||
}.bind(this)
|
||||
});
|
||||
}.bind(this));
|
||||
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + $('#PromoID').val() + '&cq=' + $.now());
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Iklan'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','PromoID','CabID','Tanggal','Info','Aktif','Cari_Iklan'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Iklan']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,107 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/disp/promo.js
|
||||
Desc. : JS - Konfigurasi Display Promo POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2015.
|
||||
Last Modified : December 8th, 2025.
|
||||
|
||||
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var DISPPromoJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Promo').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: function(ajson){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Informasi Promo', ajson.html, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_save();}.bind(this)).end()
|
||||
.find('#FileGambar').off('change').change(function(){
|
||||
var fd = new FormData(), files = $('#FileGambar')[0].files[0];
|
||||
fd.append('Gambar1', files);
|
||||
$.ajax({
|
||||
url: this.PHP+'?'+(FoniaJS.RequestParam(['data=upload-gambar','PromoID']).join('&')),
|
||||
type: 'post',
|
||||
data: fd,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(ares){
|
||||
if (ares.result != 0){
|
||||
FoniaJS.showInfo('Sukses upload file Gambar !');
|
||||
$('#PromoID').val(ares.PromoID);
|
||||
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + ares.PromoID + '&cq=' + $.now());
|
||||
} else {
|
||||
FoniaJS.showError(ares.message);
|
||||
}
|
||||
}.bind(this)
|
||||
});
|
||||
}.bind(this));
|
||||
$('#imgPhoto').attr('src', this.PHP + '?data=image&PromoID=' + $('#PromoID').val() + '&cq=' + $.now());
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','PromoID','Tanggal','Info','Warna','Font','Aktif','Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Promo']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/gel/keluar.js
|
||||
Desc. : JS - Transaksi Pengeluaran Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 23rd, 2013.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KasKeluarJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
//$('#butCari').click(function(){this.tx_brow();}.bind(this));
|
||||
this.data_query('tabel-detail', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_detail: function(mode, No_Kas){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail='+mode,'No_Kas='+No_Kas],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Pengeluaran Kas', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.tx_simpan();}.bind(this)).end()
|
||||
.find('#Jumlah').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.tx_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert') {
|
||||
$('#TXID').focus();
|
||||
} else {
|
||||
FoniaJS.setFocus('#Ket');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.tx_detail('insert', "");
|
||||
},
|
||||
|
||||
tx_ubah: function(acell){
|
||||
this.tx_detail('update', acell[0]);
|
||||
},
|
||||
|
||||
tx_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[0]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Kas='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Kas','Tgl_Kas','CabID','TXID','Ket','Jumlah'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode='+mode,'No_Kas'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/gel/terima.js
|
||||
Desc. : JS - Transaksi Penerimaan Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 23rd, 2013.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KasTerimaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
//$('#butCari').click(function(){this.tx_brow();}.bind(this));
|
||||
this.data_query('tabel-detail', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_detail: function(mode, No_Kas){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail='+mode,'No_Kas='+No_Kas],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Penerimaan Kas', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.tx_simpan();}.bind(this)).end()
|
||||
.find('#Jumlah').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.tx_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert') {
|
||||
$('#TXID').focus();
|
||||
} else {
|
||||
FoniaJS.setFocus('#Ket');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.tx_detail('insert', "");
|
||||
},
|
||||
|
||||
tx_ubah: function(acell){
|
||||
this.tx_detail('update', acell[0]);
|
||||
},
|
||||
|
||||
tx_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[0]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Kas='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Kas','Tgl_Kas','CabID','TXID','Ket','Jumlah'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode='+mode,'No_Kas'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,112 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/index.js
|
||||
Desc. : JS - Halaman Utama Desktop
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 24th, 2010.
|
||||
Last Modified : December 14th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
$(document).ready(function(){
|
||||
jQuery("#preloader").remove();
|
||||
loadSidebar();
|
||||
IndexJS.loading();
|
||||
setInterval(function(){
|
||||
if ($('#ChartB').length) return false;
|
||||
IndexJS.load_chart();
|
||||
}, 600000);
|
||||
if ('undefined' !== typeof qz) startConnection();
|
||||
});
|
||||
|
||||
var IndexJS = {
|
||||
|
||||
loading: function(){
|
||||
new Request.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=default'],
|
||||
onSuccess: function(ares){
|
||||
$('#pageContent').html(ares.content);
|
||||
$('#pageToolbarTop').html('');
|
||||
$('#pageToolbarBot').html('');
|
||||
this.load_chart();
|
||||
}.bind(this)
|
||||
}).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.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=chart-sale'],
|
||||
onSuccess: function(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.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=chart-omzet'],
|
||||
onSuccess: function(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.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/index.php',
|
||||
sendParam: ['data=tabel-stok'],
|
||||
onSuccess: function(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); }
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/beli.js
|
||||
Desc. : JS - Transaksi Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : October 19th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var BeliJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butPendingBrow').click(function(){this.pending_brow();}.bind(this));
|
||||
$('#butPendingSimpan').click(function(){this.tx_simpan('pending');}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX').find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
$('#winBTX').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
$('#winBTX').find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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(function(){this.data_query('master', 'edit')}.bind(this), 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> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_Beli'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.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!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_Beli').val());
|
||||
}.bind(this), '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($('#Total_Hutang').val())==0){
|
||||
this.total_show();
|
||||
return;
|
||||
}
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Beli').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
if ($('#No_Beli').val()) {
|
||||
var cetak = new cPRINTER(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "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"> </div>');
|
||||
this.winBPending = FoniaJS.showWindow('BPending', 'Daftar Pending Pembelian', _isi, 900, '', function(){
|
||||
this.data_query('brow-pending');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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]+'" ?', function(){
|
||||
$('#No_Beli').val(acell[0]);
|
||||
this.data_query('master', 'pending-delete');
|
||||
}.bind(this), '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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk').find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butAll').click(function(){
|
||||
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');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','No_Beli','mode','mode_detail='+mode,'ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 700, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Beli','CabID','SupID'], this.Produk_Comp);
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Nama_Produk').on('click', function(){
|
||||
$('#Nama_Produk').select();
|
||||
}).end()
|
||||
.find('#Qty').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13 && parseInt(e.target.value)>0) FoniaJS.setFocus('#Harga_Beli');
|
||||
}.bind(this)).end()
|
||||
.find('#Harga_Beli').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Rupiah');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Rupiah').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Persen1');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Persen1').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Persen2');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Persen2').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Persen3');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Persen3').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Persen4');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Persen4').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13) FoniaJS.setFocus('#Disk_Persen5');
|
||||
}.bind(this)).end()
|
||||
.find('#Disk_Persen5').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if ($('#mode_detail').val() == 'insert' && $('#InvID').val() == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
this.Hitung_Detail();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if ($('#SupID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Supplier !");
|
||||
return;
|
||||
}
|
||||
this.detail_produk('insert', 0, 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[4]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Beli','ID='+acell[0]],
|
||||
onSuccess: function(){
|
||||
var _obtn = $('button:contains("Total")');
|
||||
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-secondary').attr('id','tombolTotal').html('Hutang : '+FoniaJS.FloatToStr($('#Total_Hutang').val(),2));
|
||||
}
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Beli','ID','InvID','SatuanID','Qty','Harga_Beli','Disk_Rupiah','Disk_Persen1','Disk_Persen2','Disk_Persen3','Disk_Persen4','Disk_Persen5'],
|
||||
onSuccess: function(){
|
||||
var _obtn = $('button:contains("Total")');
|
||||
if (_obtn) _obtn.removeClass('btn-info').addClass('btn-secondary').attr('id','tombolTotal').html('Hutang : '+FoniaJS.FloatToStr($('#Total_Hutang').val(),2));
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
total_show: function(){
|
||||
if (['add','edit'].indexOf($('#mode').val()) == -1) return false;
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-total'],
|
||||
onSuccess: function(a){
|
||||
this.winTotal = FoniaJS.showWindow('Total', 'Informasi Transaksi', a.html, 500, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
var dhutang = parseFloat($('#Total_Hutang').val());
|
||||
if (dhutang==0) dhutang = parseFloat($('#Total_Beli').val());
|
||||
$('#winTotal')
|
||||
.find('#butWSimpan').click(function(){this.total_simpan();}.bind(this)).end()
|
||||
.find('#popTotal_Bulat').keyup(function(e) {
|
||||
this.Hitung_Total();
|
||||
if (e.which==13) $('#butWSimpan').focus();
|
||||
}.bind(this)).end()
|
||||
.find('#popTotal_Bulat').val($('#Total_Bulat').val()).end()
|
||||
.find('#popTotal_Hutang').val(dhutang);
|
||||
FoniaJS.setFocus('#popTotal_Bulat');
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
total_simpan: function(){
|
||||
$('#Total_Bulat').val(FoniaJS.StrToFloat($('#popTotal_Bulat').val()));
|
||||
$('#Total_Hutang').val(FoniaJS.StrToFloat($('#popTotal_Hutang').val()));
|
||||
$('#tombolTotal').html('<i class="bi-wallet2 me-1"></i>Hutang : '+FoniaJS.FloatToStr($('#Total_Hutang').val(),2));
|
||||
FoniaJS.closeWindow(this.winTotal);
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
mode = (mode) ? mode : '';
|
||||
var sparam = ['data=master','mode='+mode,'No_Beli'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if (-1 !== mode.search(/save/i)) sparam = ['data=master','mode='+mode,'No_Beli','Tgl_Beli','Tgl_Faktur','No_Faktur','CabID','SupID','Total_Bulat='+FoniaJS.StrToFloat($('#Total_Bulat').val()),'Total_Hutang='+FoniaJS.StrToFloat($('#Total_Hutang').val())];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_Beli').keyup(function(e){
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Beli")) && ($("#No_Beli").val() !== '')) this.data_query('master');
|
||||
}
|
||||
}.bind(this));
|
||||
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');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_Beli'],
|
||||
onSuccess: function(){
|
||||
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($('#Total_Hutang').val(),2));
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-pending"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-pending','Cari_Pending'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Pending');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk','Filter_Browse','SupID'],
|
||||
onSuccess: function(){
|
||||
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[1]);
|
||||
$('#Harga_Jual').val(FoniaJS.FloatToStr(adata[3]));
|
||||
BeliJS.update_Items();
|
||||
},
|
||||
|
||||
update_Items: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-item','InvID','SatuanID','SupID'],
|
||||
onSuccess: function(adata){
|
||||
if (!adata.data) {
|
||||
$('#Harga_Beli').val(FoniaJS.FloatToStr(adata.Harga_Beli));
|
||||
$('#Disk_Rupiah').val(adata.Disk_Rupiah);
|
||||
$('#Disk_Persen1').val(adata.Disk_Persen1);
|
||||
$('#Disk_Persen2').val(adata.Disk_Persen2);
|
||||
$('#Disk_Persen3').val(adata.Disk_Persen3);
|
||||
$('#Disk_Persen4').val(adata.Disk_Persen4);
|
||||
$('#Disk_Persen5').val(adata.Disk_Persen5);
|
||||
this.Hitung_Detail();
|
||||
}
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}.bind(this)
|
||||
}).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));
|
||||
},
|
||||
|
||||
Hitung_Total: function(){
|
||||
var dbeli = FoniaJS.StrToFloat($('#Total_Beli').val());
|
||||
var dbulat = FoniaJS.StrToFloat($('#popTotal_Bulat').val());
|
||||
$('#popTotal_Hutang').val(FoniaJS.FloatToStr(dbeli-dbulat,2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,174 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/beli_lunas.js
|
||||
Desc. : JS - Transaksi Pembayaran Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 7th, 2011.
|
||||
Last Modified : October 8th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var BeliLunasJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butMode').click(function(){this.tx_mode();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
if (FoniaJS.User.Level>0) $('#butMode').hide();
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_mode: function(){
|
||||
var mode = ($('#Mode_Tampil').val()==1) ? 0 : 1;
|
||||
$('#Mode_Tampil').val(mode);
|
||||
$('#butMode').html('<i class="bi-list me-2"></i>'+(mode==1?'Semua':'Normal'));
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
$('#divTXNota').removeClass('d-none');
|
||||
$('#divDetailNota').addClass('d-none');
|
||||
$('#divDetailBayar').addClass('d-none');
|
||||
if (FoniaJS.User.Level==0) $('#butMode').removeClass('d-none');
|
||||
$('#butBatal').addClass('d-none');
|
||||
$('#butBrow').prop('disabled', false).removeClass('btn-secondary').addClass('btn-info');
|
||||
$('#Nama_Sup').prop('disabled', false).removeClass('disabled').addClass('enabled');
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
sup_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Sup" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowSup"> </div>');
|
||||
this.winBSup = FoniaJS.showWindow('BSup', 'Daftar Supplier', _isi, 900, '', function(){
|
||||
$('#winBSup').find('#Cari_Sup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
$('#winBSup').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
$('#winBSup').find('#butAll').click(function(){
|
||||
$('#winBSup').find('#Cari_Sup').val('');
|
||||
this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
this.data_query('brow-sup');
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-nota','No_Beli='+acell[1],'Tipe_Nota='+acell[0]],
|
||||
onSuccess: function(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');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_show: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-bayar','No_Beli','Total_Sisa'],
|
||||
onSuccess: function(ajson){
|
||||
this.winBayar = FoniaJS.showWindow('Bayar', 'Detail Pembayaran', ajson.html, 500, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winBayar').find('#butWSimpan').click(function(){this.bayar_simpan();}.bind(this));
|
||||
this.Hitung_Detail();
|
||||
FoniaJS.setFocus('#Total_Bayar');
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-bayar','mode_detail=delete','No_Beli','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-bayar','mode_detail=insert','No_Beli','Tgl_Bayar','Total_Bayar','Total_Potong','Tipe_Nota'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBayar);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','SupID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')],
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
this.tx_batal();
|
||||
FoniaJS.AutoComplete('#Nama_Sup', this.PHP, ['data=auto-sup'], this.Sup_Comp);
|
||||
$('#Nama_Sup').on('click', function(){
|
||||
$('#Nama_Sup').select();
|
||||
});
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
}
|
||||
FoniaJS.setFocus('#Nama_Sup');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-nota"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-nota','SupID','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="tabel-bayar"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-bayar','No_Beli','Lunas','Mode_Tampil']
|
||||
}).send();
|
||||
} else if (tipe=="brow-sup"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-sup','Cari_Sup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Sup_Comp: function(item){
|
||||
$('#SupID').val(item.value);
|
||||
$('#Alamat_Sup').val(item.data);
|
||||
BeliLunasJS.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
$('#Temp_Sisa').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Temp_Total').val()) - FoniaJS.StrToFloat($('#Total_Bayar').val()) - FoniaJS.StrToFloat($('#Total_Potong').val()), 2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,165 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/beli_lunas_sup.js
|
||||
Desc. : JS - Transaksi Pelunasan Pembelian / Supplier
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 7th, 2011.
|
||||
Last Modified : December 11th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var BeliLunasSupJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_simpan: function(mode){
|
||||
FoniaJS.showConfirm("Konfirmasi", "Yakin akan proses Pelunasan ?", function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses-bayar','SupID','Tgl_Bayar'],
|
||||
onSuccess: function(){
|
||||
this.data_query('tabel-nota');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'warning');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#SupID').val(0);
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
sup_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Sup" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowSup"> </div>');
|
||||
this.winBSup = FoniaJS.showWindow('BSup', 'Daftar Supplier', _isi, 900, '', function(){
|
||||
$('#winBSup').find('#Cari_Sup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
$('#winBSup').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
$('#winBSup').find('#butAll').click(function(){
|
||||
$('#winBSup').find('#Cari_Sup').val('');
|
||||
this.data_query('brow-sup');
|
||||
}.bind(this));
|
||||
this.data_query('brow-sup');
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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');
|
||||
},
|
||||
|
||||
bayar_tampil: function(acell){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-bayar'],
|
||||
onSuccess: function(ajson){
|
||||
this.winBayar = FoniaJS.showWindow('Bayar', 'Detail Pembayaran', ajson.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winBayar')
|
||||
.find('#butWSimpan').click(function(){this.bayar_simpan();}.bind(this)).end()
|
||||
.find('#Jumlah_Bayar').keyup(function(e) {this.Hitung_Bayar();}.bind(this)).end()
|
||||
.find('#Jumlah_Potong').keyup(function(e) {this.Hitung_Bayar();}.bind(this)).end()
|
||||
.find('#No_Beli').val(acell[0]).end()
|
||||
.find('#No_Faktur').val(acell[1]).end()
|
||||
.find('#Tgl_Faktur').val(acell[2]).end()
|
||||
.find('#Faktur').val(this.IDR_to_USD(acell[3])).end()
|
||||
.find('#SBayar').val(this.IDR_to_USD(acell[4])).end()
|
||||
.find('#Jumlah_Faktur').val(this.IDR_to_USD(acell[5])).end()
|
||||
.find('#Jumlah_Bayar').val(this.IDR_to_USD((acell[6]==0?acell[5]:acell[6]))).end()
|
||||
.find('#Jumlah_Potong').val(this.IDR_to_USD(acell[7]));
|
||||
this.Hitung_Bayar();
|
||||
FoniaJS.setFocus('#Jumlah_Bayar');
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_simpan: function(){
|
||||
var djumlah = FoniaJS.StrToFloat($('#Jumlah_Faktur').val());
|
||||
var dbayar = FoniaJS.StrToFloat($('#Jumlah_Bayar').val());
|
||||
var dpot = FoniaJS.StrToFloat($('#Jumlah_Potong').val());
|
||||
if (djumlah<(dbayar+dpot)) {
|
||||
FoniaJS.showError('Jumlah Pembayaran melebihi Jumlah Faktur !');
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-nota','mode_detail','SupID','No_Beli','Jumlah_Bayar','Jumlah_Potong'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBayar);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode='+mode,'SupID'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')],
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
FoniaJS.AutoComplete('#Nama_Sup', this.PHP, ['data=auto-sup'], this.Sup_Comp);
|
||||
$('#Nama_Sup').on('click', function(){
|
||||
$('#Nama_Sup').select();
|
||||
});
|
||||
$('#Disp_Bayar').addClass('border-success');
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
}
|
||||
this.data_query('tabel-nota');
|
||||
FoniaJS.setFocus('#Nama_Sup');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-nota"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-nota','SupID']
|
||||
}).send();
|
||||
} else if (tipe=="brow-sup"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-sup','Cari_Sup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Sup_Comp: function(item){
|
||||
$('#SupID').val(item.value);
|
||||
$('#Alamat_Sup').val(item.data);
|
||||
BeliLunasSupJS.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
Hitung_Bayar: function(){
|
||||
var djumlah = FoniaJS.StrToFloat($('#Jumlah_Faktur').val());
|
||||
var dbayar = FoniaJS.StrToFloat($('#Jumlah_Bayar').val());
|
||||
var dpot = FoniaJS.StrToFloat($('#Jumlah_Potong').val());
|
||||
$('#Sisa_Bayar').val(FoniaJS.FloatToStr(djumlah-dbayar-dpot, 2));
|
||||
},
|
||||
|
||||
IDR_to_USD: function(value){
|
||||
var nilai = value.replace(/\./g,'').replace(',','.');
|
||||
return FoniaJS.FloatToStr(parseFloat(nilai));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,290 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/beli_retur.js
|
||||
Desc. : JS - Transaksi Retur Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : October 10th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var BeliReturJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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(function(){this.data_query('master', 'edit')}.bind(this), 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> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_Beli'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.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!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_Beli').val());
|
||||
}.bind(this), '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 ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Beli').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
if ($('#No_Beli').val()) {
|
||||
var cetak = new cPRINTER(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','mode','mode_detail='+mode,'No_Beli','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 700, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Beli','CabID','SupID'], {'selectFunc': BeliReturJS.Produk_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Qty').keyup(function(e){
|
||||
this.Hitung_Detail();
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Beli');
|
||||
}.bind(this)).end()
|
||||
.find('#Harga_Beli').keyup(function(e){
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert' && InvID == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
this.Hitung_Detail();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if ($('#SupID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Supplier !");
|
||||
return;
|
||||
}
|
||||
this.detail_produk('insert', 0, 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[2]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Beli','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Beli','CabID','ID','InvID','SatuanID','Qty','Harga_Beli'],
|
||||
onSuccess: function(){
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['data=master','mode='+mode,'No_Beli'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['data=master','mode=save','No_Beli','Tgl_Beli','CabID','SupID','No_Faktur'];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_Beli').keyup(function(e){
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Beli")) && ($("#No_Beli").val() !== '')) this.data_query('master');
|
||||
}
|
||||
}.bind(this));
|
||||
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');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#No_Beli');
|
||||
}
|
||||
if ($('#mode').val()=='print') this.tx_print(true);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_Beli']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','CabID','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
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[1]);
|
||||
$('#Harga_Beli').val(adata[2]);
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * FoniaJS.StrToFloat($('#Harga_Beli').val()), 2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,113 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/cekharga.js
|
||||
Desc. : JS - Informasi Barang & Harga Jual
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 22nd, 2014.
|
||||
Last Modified : January 4th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var CekHargaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
html5QrcodeScanner: null,
|
||||
|
||||
loading: function(){
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
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 }, CekHargaJS.ScanSukses);
|
||||
} else {
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': CekHargaJS.Produk_Comp});
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}
|
||||
},
|
||||
/* release QRScanner
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
this.html5QrcodeScanner.resume();
|
||||
} else FoniaJS.setFocus('Nama_Produk');
|
||||
*/
|
||||
|
||||
ScanSukses: function(decodedText, decodedResult){
|
||||
new Request.JSON({
|
||||
url: CekHargaJS.PHP,
|
||||
sendParam: ['data=scan-produk','Cari_Produk='+decodedText],
|
||||
onSuccess: function(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();
|
||||
//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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Kode_Barang').val(acell[1]+' / '+acell[2]);
|
||||
$('#Nama_Barang').val(acell[5]);
|
||||
$('#Nama_Satuan').val(acell[6]);
|
||||
$('#Harga_Jual').val(acell[4]);
|
||||
this.update_Sup();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Barang').val(adata[1]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
$('#Harga_Jual').val(adata[3]);
|
||||
$('#Nama_Produk').val('');
|
||||
$('#Nama_Produk').focus();
|
||||
CekHargaJS.update_Sup();
|
||||
},
|
||||
|
||||
update_Sup: function(){
|
||||
if ($('#InvID').val()==0) return false;
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_supplier','InvID']
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,294 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/mutasi.js
|
||||
Desc. : JS - Transaksi Mutasi Stok Cabang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : February 28th, 2011.
|
||||
Last Modified : December 10th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var MutasiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_Mutasi'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.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!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_Mutasi').val());
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Mutasi').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
if ($('#No_Mutasi').val()) {
|
||||
var cetak = new cPRINTER(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "nota-mutasi");
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
return;
|
||||
}
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
produk_brow: 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;
|
||||
}
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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, HPP){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','mode','mode_detail='+mode,'No_Mutasi','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'HPP='+HPP],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Mutasi','Dari_CabID'], {'selectFunc': MutasiJS.Produk_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Qty').keyup(function(e){
|
||||
this.Hitung_Detail();
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert' && InvID == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
this.Hitung_Detail();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}
|
||||
}.bind(this), null, false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: 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.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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Mutasi','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Mutasi','Dari_CabID','Ke_CabID','ID','InvID','SatuanID','Qty','Harga_Beli'],
|
||||
onSuccess: function(){
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['data=master','mode='+mode,'No_Mutasi'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['data=master','mode=save','No_Mutasi','Tgl_Mutasi','Dari_CabID','Ke_CabID','Catatan'];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_Mutasi').keyup(function(e){
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Mutasi")) && ($("#No_Mutasi").val() !== '')) this.data_query('master');
|
||||
}
|
||||
}.bind(this));
|
||||
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');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#No_Mutasi');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_Mutasi']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Dari_CabID','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[3]);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
$('#Harga_Beli').val(adata[4]);
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * FoniaJS.StrToFloat($('#Harga_Beli').val()), 2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,286 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/opname.js
|
||||
Desc. : JS - Transaksi Opname Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 24th, 2010.
|
||||
Last Modified : September 29th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OpnameJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX')
|
||||
.find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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(function(){this.data_query('master', 'edit')}.bind(this), 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> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_Opname'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.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!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_Opname').val());
|
||||
}.bind(this), '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 ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Opname').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
if ($('#No_Opname').val()) {
|
||||
var cetak = new cPRINTER(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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, HPP){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','mode','mode_detail='+mode,'No_Opname','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'HPP='+HPP],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Opname','Tgl_Opname','CabID'], {'selectFunc': OpnameJS.Produk_Comp});
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Qty').keyup(function(e){
|
||||
if (parseFloat(e.target.value) == 0) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if (mode == 'insert' && InvID == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}
|
||||
this.update_stok();
|
||||
}.bind(this), null, false);
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_Opname','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_Opname','CabID','ID','InvID','SatuanID','Qty','Harga_Beli'],
|
||||
onSuccess: function(){
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
var sparam = ['data=master','mode='+mode,'No_Opname'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['data=master','mode=save','No_Opname','Tgl_Opname','CabID','Catatan'];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: function(ajson){
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_Opname').keyup(function(e){
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_Opname")) && ($("#No_Opname").val() !== '')) this.data_query('master');
|
||||
}
|
||||
}.bind(this));
|
||||
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');
|
||||
}
|
||||
if (ajson.error) {
|
||||
FoniaJS.showError(ajson.error);
|
||||
FoniaJS.setFocus('#No_Opname');
|
||||
}
|
||||
if ($('#mode').val()=='print') this.tx_print(true);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_Opname']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','CabID','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[3]);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
$('#Harga_Beli').val(adata[4]);
|
||||
OpnameJS.update_stok();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
update_stok: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_stok','Tgl_Opname','CabID','InvID']
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,128 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/opname_barang.js
|
||||
Desc. : JS - Transaksi Penyesuaian Stok Per Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 22nd, 2014.
|
||||
Last Modified : September 21st, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OpnameBarangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
html5QrcodeScanner: null,
|
||||
|
||||
loading: function(){
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
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, ['data=auto-produk'], {'selectFunc': OpnameBarangJS.Produk_Comp});
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
if ($('#InvID').val()==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Produk!');
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=simpan-opname','InvID','Stok_Fisik'],
|
||||
onSuccess: function(ares){
|
||||
if (ares.Status){
|
||||
FoniaJS.showInfo('Sukses simpan penyesuaian Stok !');
|
||||
$('#InvID').val(0);
|
||||
$('.form-control').val('')
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
this.html5QrcodeScanner.resume();
|
||||
} else FoniaJS.setFocus('Nama_Produk');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
ScanSukses: function(decodedText, decodedResult){
|
||||
new Request.JSON({
|
||||
url: OpnameBarangJS.PHP,
|
||||
sendParam: ['data=scan-produk','Cari_Produk='+decodedText],
|
||||
onSuccess: function(ajson){
|
||||
$('#InvID').val(ajson.InvID);
|
||||
$('#Kode_Barang').val(ajson.Kode_Barang);
|
||||
$('#Nama_Barang').val(ajson.Nama_Barang);
|
||||
$('#Nama_Satuan').val(ajson.Nama_Satuan);
|
||||
$('#Stok_Sistem').val(ajson.Stok_Sistem);
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Kode_Barang').val(acell[1]+' / '+acell[2]);
|
||||
$('#Nama_Barang').val(acell[5]);
|
||||
$('#Nama_Satuan').val(acell[6]);
|
||||
OpnameBarangJS.update_Stok();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#Kode_Barang').val(adata[0]);
|
||||
$('#Nama_Barang').val(adata[1]);
|
||||
$('#Nama_Satuan').val(adata[2]);
|
||||
OpnameBarangJS.update_Stok();
|
||||
},
|
||||
|
||||
update_Stok: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=cek_stok','InvID'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Stok_Fisik');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,348 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/po.js
|
||||
Desc. : JS - Transaksi Pembuatan Purchase Order
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 22th, 2010.
|
||||
Last Modified : January 19th, 2026.
|
||||
|
||||
(c) 2010 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var POJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){
|
||||
$('#butTambah').click(function(){this.tx_tambah();}.bind(this));
|
||||
$('#butUbah').click(function(){this.tx_ubah();}.bind(this));
|
||||
$('#butHapus').click(function(){this.tx_hapus();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.tx_simpan();}.bind(this));
|
||||
$('#butBatal').click(function(){this.tx_batal();}.bind(this));
|
||||
$('#butPrint').click(function(){this.tx_print();}.bind(this));
|
||||
$('#butShare').click(function(){this.tx_share();}.bind(this));
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 900, '', function(){
|
||||
$('#winBTX').find('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
$('#winBTX').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
$('#winBTX').find('#butAll').click(function(){
|
||||
$('#winBTX').find('#Cari_TX').val('');
|
||||
this.data_query('brow-tx');
|
||||
}.bind(this));
|
||||
this.data_query('brow-tx');
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#No_PO').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
if (!$('#No_PO').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showAuth(function(){this.data_query('master', 'edit')}.bind(this), this, 'EDIT '+$('#No_PO').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
if (!$('#No_PO').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <strong>'+$('#No_PO').val()+'</strong> ?', function(){
|
||||
FoniaJS.showAuth(function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=delete','No_PO'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
$('#No_PO').val('');
|
||||
this.data_query('master', 'view');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), this, 'DELETE '+$('#No_PO').val());
|
||||
}.bind(this), '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;
|
||||
}
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', function(){
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_PO').val('');
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(){
|
||||
if ($('#No_PO').val()) {
|
||||
if (FoniaJS.WEB_MOBILE){
|
||||
var dload = new cEXPORT({'url':FoniaJS.WEB_PATH+'apps/php/pdf/po.php'});
|
||||
dload.add_param("data", "pdf-po");
|
||||
dload.add_param("mode", "share");
|
||||
dload.add_param("Nomor_Cetak", $('#No_PO').val());
|
||||
dload.download();
|
||||
} else {
|
||||
var cetak = new cPDF(FoniaJS.WEB_PATH+'apps/php/pdf/po.php');
|
||||
cetak.add_param("data", "pdf-po");
|
||||
cetak.add_param("Nomor_Cetak", $('#No_PO').val());
|
||||
cetak.showPDF();
|
||||
}
|
||||
return;
|
||||
}
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
tx_share: function(){
|
||||
if ($('#No_PO').val()) {
|
||||
var dload = new cSHARE({'url':FoniaJS.WEB_PATH+'apps/php/pdf/po.php'});
|
||||
dload.add_param("data", "pdf-po");
|
||||
dload.add_param("mode", "share");
|
||||
dload.add_param("Nomor_Cetak", $('#No_PO').val());
|
||||
dload.share();
|
||||
return;
|
||||
}
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk').find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butAll').click(function(){
|
||||
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');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','No_PO','mode','mode_detail='+mode,'ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 700, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_PO','CabID','SupID'], this.Produk_Comp);
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Nama_Produk').on('click', function(){
|
||||
$('#Nama_Produk').select();
|
||||
}).end()
|
||||
.find('#Qty').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13 && parseInt(e.target.value)>0) FoniaJS.setFocus('#Harga_Beli');
|
||||
}.bind(this)).end()
|
||||
.find('#Harga_Beli').keyup(function(e) {
|
||||
this.Hitung_Detail();
|
||||
if (e.which==13 && FoniaJS.StrToFloat($('#Jumlah').val())>0) this.detail_simpan();
|
||||
}.bind(this));
|
||||
if ($('#mode_detail').val() == 'insert' && $('#InvID').val() == 0) {
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
} else {
|
||||
if ($('#mode_detail').val() != 'insert') this.Hitung_Detail();
|
||||
this.Update_Items();
|
||||
}
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_tambah: function(){
|
||||
if ($('#SupID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Nama Supplier !");
|
||||
return;
|
||||
}
|
||||
this.detail_produk('insert', 0, 0, 0);
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[4]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=delete','No_PO','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), '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,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail','No_PO','ID','InvID','SatuanID','Qty','Harga_Beli','Harga_HPP'],
|
||||
onSuccess: function(){
|
||||
if (_mdetail=='insert') { this.detail_tambah(); } else FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
if (tipe=="master"){
|
||||
mode = (mode) ? mode : '';
|
||||
var sparam = ['data=master','mode='+mode,'No_PO'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if (-1 !== mode.search(/save/i)) sparam = ['data=master','mode='+mode,'No_PO','Tgl_PO','CabID','SupID','Total_Beli'];
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: (ajson) => {
|
||||
$('#divTXMaster').html(ajson.html);
|
||||
$('#No_PO').keyup((e) => {
|
||||
if ((e.which || e.keyCode) == 13) {
|
||||
if (($("#No_PO")) && ($("#No_PO").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');
|
||||
$('#butShare').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');
|
||||
$('#butShare').removeClass('d-none');
|
||||
$('#butSimpan').addClass('d-none');
|
||||
$('#butBatal').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_PO');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','No_PO']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-tx','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk','Filter_Browse','SupID','No_PO'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[0]);
|
||||
$('#Nama_Satuan1').val(adata[1]);
|
||||
$('#Nama_Satuan2').val(adata[1]);
|
||||
$('#Harga_Beli').val(FoniaJS.FloatToStr(adata[3]));
|
||||
$('#Harga_HPP').val(FoniaJS.FloatToStr(adata[3]));
|
||||
POJS.Update_Items();
|
||||
},
|
||||
|
||||
oc_SupID: function(ob){
|
||||
if (ob.value == 0) return false;
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode','mode_detail=sup-baru','No_PO','SupID']
|
||||
}).send();
|
||||
},
|
||||
|
||||
Update_Items: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-item','InvID'],
|
||||
onSuccess: function(adata){
|
||||
if (!adata.data) {
|
||||
$('#Stok').val(FoniaJS.FloatToStr(adata.Stok));
|
||||
}
|
||||
FoniaJS.setFocus('#Qty');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
var dqty = FoniaJS.StrToFloat($('#Qty').val());
|
||||
var dharga = FoniaJS.StrToFloat($('#Harga_Beli').val());
|
||||
var dtot = dharga * dqty;
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(dtot,2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,525 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/iss/pos.js
|
||||
Desc. : JS - Transaksi Penjualan / Kasir POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 5th, 2012.
|
||||
Last Modified : January 21st, 2026.
|
||||
|
||||
(c) 2012 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var POSJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
POLE_DISP: null,
|
||||
POLE_CONF: {},
|
||||
|
||||
loading: function(){
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk','No_Jual'], {'selectFunc': POSJS.Produk_Comp, 'keyFunc': POSJS.Produk_Key, 'breakValue': ['*9']});
|
||||
$('#Nama_Produk').click(() => $('#Nama_Produk').select());
|
||||
$('#POS_Qty').on({
|
||||
keyup: (e) => {
|
||||
(13 == e.which) && $('#Nama_Produk').focus();
|
||||
},
|
||||
click: () => $('#POS_Qty').select()
|
||||
});
|
||||
this.data_query('master');
|
||||
//POLE DISPLAY
|
||||
this.data_query('pole-config');
|
||||
},
|
||||
|
||||
proses_oc: function(){
|
||||
var cetak = new cPRINTERPOS(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "opencash");
|
||||
cetak.exec();
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
proses_print: function(oc){
|
||||
var _no_jual = $('#No_Cetak').val();
|
||||
var cetak = new cPRINTERPOS(FoniaJS.WEB_PATH+'apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "nota-pos");
|
||||
cetak.add_param("Nomor_Cetak", _no_jual);
|
||||
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', 'Apakah Anda yakin ingin membatalkan ?<br>Semua item transaksi 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"> </div>');
|
||||
this.winBNota = FoniaJS.showWindow('BNota', 'Daftar Transaksi', _isi, 900, '', () => {
|
||||
$('#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 Transaksi Pending', '<div id="divBrowPending"> </div>', 900, '', () => this.data_query('brow-pending'));
|
||||
},
|
||||
|
||||
pending_select: function(acell){
|
||||
$('#No_Jual').val(acell[0]);
|
||||
FoniaJS.closeWindow(this.winBPend);
|
||||
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');
|
||||
},
|
||||
|
||||
produk_add: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=info_produk'],
|
||||
onSuccess: (txt) => {
|
||||
this.winBarang = FoniaJS.showWindow('Barang', 'Penambahan Item Barang', txt, 600, [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winBarang')
|
||||
.find('#butSimpan').click(() => this.produk_simpan()).end()
|
||||
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
|
||||
.find('#Kode_Barcode').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Nama_Barang');
|
||||
}).end()
|
||||
.find('#Nama_Barang').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Grup_InvID');
|
||||
}).end()
|
||||
.find('#Grup_InvID').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#StokID');
|
||||
}).end()
|
||||
.find('#StokID').keyup((e) => {
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Jual');
|
||||
});
|
||||
FoniaJS.setFocus('#Kode_Barcode');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_simpan: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=simpan_produk','Kode_Barcode','Nama_Barang','Grup_InvID','StokID','Harga_Jual'],
|
||||
onSuccess: (ajson) => {
|
||||
if (ajson.msg) FoniaJS.showInfo(ajson.msg);
|
||||
FoniaJS.closeWindow(this.winBarang);
|
||||
$('#Nama_Produk').val('').focus();
|
||||
}
|
||||
}).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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', () => {
|
||||
$('#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((e) => {
|
||||
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]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_produk','mode_detail='+mode,'No_Jual','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID],
|
||||
onSuccess: (txt) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', txt, 600, [{},{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])) FoniaJS.setFocus('#Harga_Diskon');
|
||||
}).end()
|
||||
.find('#Harga_Diskon').keyup((e) => {
|
||||
this.Hitung_Detail(1);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
|
||||
}
|
||||
}).end()
|
||||
.find('#Persen_Diskon').keyup((e) => {
|
||||
this.Hitung_Detail(2);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0) this.detail_simpan();
|
||||
}
|
||||
});
|
||||
this.Hitung_Detail(1);
|
||||
FoniaJS.setFocus('#Qty');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
if (parseInt(acell[3])==1){
|
||||
this.detail_lain('update', acell[0]);
|
||||
} else
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','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($('#Persen_Diskon').val())>=100) {
|
||||
FoniaJS.showInfo('Nilai Diskon diluar batas !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','No_Jual','InvID','SatuanID','Qty','Harga_Beli','Harga_Jual','Harga_Diskon','ID','Ket'],
|
||||
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('');
|
||||
$('#Nama_Produk').focus();
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_lain: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_lain','mode_detail='+mode,'No_Jual','ID='+ID],
|
||||
onSuccess: (txt) => {
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', txt, 600, [{},{i:'butBatal'},{i:'butSimpan',v:'Simpan',c:'success'}], () => {
|
||||
$('#winDetail')
|
||||
.find('#butSimpan').click(() => this.detail_simpan()).end()
|
||||
.find('#butBatal').click(() => $('#Nama_Produk').focus()).end()
|
||||
.find('#Ket').keyup((e) => {
|
||||
if ('' === e.target.value) return false;
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Qty');
|
||||
}).end()
|
||||
.find('#Qty').keyup((e) => {
|
||||
this.Hitung_Detail(0);
|
||||
if (-1!==$.inArray(e.which, [13,9])) FoniaJS.setFocus('#Harga_Jual');
|
||||
}).end()
|
||||
.find('#Harga_Jual').keyup((e) => {
|
||||
this.Hitung_Detail(0);
|
||||
if (13==e.which) {
|
||||
if (FoniaJS.StrToFloat($('#Qty').val())>0 && FoniaJS.StrToFloat($('#Harga_Jual').val())>0) this.detail_simpan();
|
||||
}
|
||||
});
|
||||
this.Hitung_Detail(0);
|
||||
FoniaJS.setFocus('#Ket');
|
||||
});
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
kasir_show: function(){
|
||||
//POLE DISPLAY
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP.Send([{'t':'Total '+$('#Total_Disp').html(),'a':'C'},{'t':'Tunai / Non Tunai ?','a':'C'}]);
|
||||
}
|
||||
if ($('#Total_Item').val()==0) {
|
||||
FoniaJS.showInfo('Belum ada transaksi !');
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=info_kasir','No_Jual','Total_Nota'],
|
||||
onSuccess: (adata) => {
|
||||
this.winKasir = FoniaJS.showWindow('Kasir', 'Informasi Pembayaran', adata.html, 500, '', () => {
|
||||
$('#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(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');
|
||||
},
|
||||
|
||||
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 = ['data=master','mode='+mode,'No_Jual','No_Cetak'];
|
||||
if (-1 !== mode.search(/save/i)) sparam = ['data=master','mode='+mode,'No_Jual','Tgl_Jual','Total_Tunai','Total_Kartu','Total_Bayar','KartuID','No_Kartu','Nama_Kartu'];
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: sparam,
|
||||
onSuccess: (txt) => {
|
||||
$('#divPOS2').html(txt);
|
||||
$('#posPEND').click(() =>this.pending_brow());
|
||||
$('#posTAMBAH').click(() => this.produk_add());
|
||||
$('#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();
|
||||
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,
|
||||
sendParam: ['data=detail','No_Jual']
|
||||
}).send();
|
||||
} else if (tipe=='brow-produk'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='brow-nota'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-nota','Cari_Nota'],
|
||||
onSuccess: () => {
|
||||
FoniaJS.setFocus('#Cari_Nota');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='brow-pending'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-pending']
|
||||
}).send();
|
||||
} else if (tipe=='pole-config'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=pole-config'],
|
||||
onSuccess: (acfg) => {
|
||||
if (typeof acfg.pole == 'object'){
|
||||
this.POLE_CONF = acfg.pole;
|
||||
if (this.POLE_CONF.ENABLE){
|
||||
this.POLE_DISP = new cPOLEDISPLAY(this.POLE_CONF.PORT);
|
||||
this.POLE_DISP.Open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var _qty = $('#POS_Qty').val();
|
||||
var adata = item.data.split(':');
|
||||
//todo: jika stok kosong tidak simpan hanya utk glamore
|
||||
//if (parseInt(adata[3])>0 || _qty<0){
|
||||
new Request.JSONF({
|
||||
url: POSJS.PHP,
|
||||
sendParam: ['data=detail','mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[0],'Qty='+_qty,'Harga_Beli='+adata[1],'Harga_Jual='+adata[2]],
|
||||
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 (val == '*9') {
|
||||
if (key == 13) POSJS.detail_lain('insert', 0);
|
||||
} else {
|
||||
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();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
onblur_Qty: function(){
|
||||
if ($('#POS_Qty').val()==0) $('#POS_Qty').val('1.00');
|
||||
},
|
||||
|
||||
Hitung_Detail: function(tipe){
|
||||
if (tipe==1) $('#Persen_Diskon').val(FoniaJS.FloatToStr((FoniaJS.StrToFloat($('#Harga_Diskon').val())*100) / FoniaJS.StrToFloat($('#Harga_Jual').val()), 2));
|
||||
if (tipe==2) $('#Harga_Diskon').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Jual').val()) * FoniaJS.StrToFloat($('#Persen_Diskon').val()) * 0.01, 2));
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * (FoniaJS.StrToFloat($('#Harga_Jual').val()) - FoniaJS.StrToFloat($('#Harga_Diskon').val())), 2));
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,84 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/login.js
|
||||
Desc. : JS - Halaman Proses Login
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 15th, 2008.
|
||||
Last Modified : June 28th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
$(document).ready(function(){
|
||||
$('#butLogin').click(LoginJS.Proses_Login);
|
||||
$('#Username').keydown(function(e){
|
||||
if (e.which==13) $('#Password').focus();
|
||||
});
|
||||
$('#Password').keydown(function(e){
|
||||
if (e.which==13) $('#butLogin').trigger('click');
|
||||
});
|
||||
LoginJS.Tampil_Login();
|
||||
document.oncontextmenu = new Function ('return false');
|
||||
|
||||
$.backstretch([
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/toko_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"assets/images/bs/toko_960.jpg" }
|
||||
],
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/rak_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"assets/images/bs/rak_960.jpg" }
|
||||
],
|
||||
[
|
||||
{ width: 1280, url: FoniaJS.WEB_PATH+"assets/images/bs/shop_1280.jpg" },
|
||||
{ width: 960, url: FoniaJS.WEB_PATH+"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.JSON({
|
||||
url: FoniaJS.WEB_PATH+'apps/php/login.php',
|
||||
sendParam: ['mode=login','Username','Password'],
|
||||
onSuccess: function(respon){
|
||||
if (respon.hasil == 'SUKSES'){
|
||||
FoniaJS.setCookie('Username', $('#Username').val(), 365);
|
||||
$('#divLoginMsg').html(respon.pesan).removeClass('d-none');
|
||||
$('.input-group').addClass('d-none');
|
||||
setTimeout(function(){self.location = FoniaJS.WEB_PATH+'?auth='+(respon.token??'');}, 1600);
|
||||
}else{
|
||||
FoniaJS.showInfo(respon.pesan, 3000);
|
||||
if (respon.redir) setTimeout(function(){self.location = respon.redir;}, 600);
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,175 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/promo/barang.js
|
||||
Desc. : JS - Pengaturan Promo Penjualan Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 28th, 2014.
|
||||
Last Modified : December 9th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PromoBarangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Promo').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Promo', txt, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
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();
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','PromoID','InvID','SatuanID','CabID','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: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk').find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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[2]);
|
||||
this.update_Items(acell[0], 0, 1);
|
||||
} else {
|
||||
$('#Promo_InvID').val(acell[0]);
|
||||
$('#Promo_Produk').val(acell[2]);
|
||||
this.update_Items(acell[0], 0, 2);
|
||||
}
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Promo']
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_item','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);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,118 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/promo/iklan.js
|
||||
Desc. : JS - Pengaturan Promo Iklan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 28th, 2014.
|
||||
Last Modified : December 10th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PromoIklanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Promo').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoNotaID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Promo', txt, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','PromoNotaID='+acell[0],'Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','PromoNotaID','Nama_Promo','Jual_Min','Jual_Grup','CabID','Promo_Iklan','Jumlah_Promo','Tgl_Mulai','Tgl_Akhir','Aktif','Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_list: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=grup-list','Jual_Grup'],
|
||||
onSuccess: function(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'}], function(){
|
||||
$('#winGrup')
|
||||
.find('#butWSAll').click(function(){this.grup_semua();}.bind(this)).end()
|
||||
.find('#butWCAll').click(function(){this.grup_clear();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.grup_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_semua: function(){
|
||||
$('#tabGrupList').find('input:checkbox').prop('checked', true);
|
||||
},
|
||||
|
||||
grup_clear: function(){
|
||||
$('#tabGrupList').find('input:checkbox').prop('checked', false);
|
||||
},
|
||||
|
||||
grup_save: function(){
|
||||
var alist = [];
|
||||
$('#tabGrupList').find('input:checkbox:checked').each(function(){
|
||||
alist.push($(this).val());
|
||||
})
|
||||
$('#Jual_Grup').val(alist.join());
|
||||
FoniaJS.closeWindow(this.winGrup);
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Promo']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,187 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/promo/total.js
|
||||
Desc. : JS - Pengaturan Promo Total Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 28th, 2014.
|
||||
Last Modified : December 10th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PromoTotalJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Promo').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Promo').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Promo');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=promo-detail','mode_detail='+mode,'PromoID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Promo', txt, 'xl', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
if ($.inArray($("#mode_detail").val(),['insert','update']) !== -1) {
|
||||
this.update_Items($('#Promo_InvID').val(), $('#Promo_SatuanID').val());
|
||||
this.oc_PilihP();
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','PromoID='+acell[0],'Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','PromoID','Nama_Promo','Jual_Min','Jual_Grup','CabID','Tipe_Promo','Promo_Jual','Promo_InvID','Promo_SatuanID','Promo_Qty','Jumlah_Promo','Tgl_Mulai','Tgl_Akhir','Aktif','Cari_Promo'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_list: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=grup-list','Jual_Grup'],
|
||||
onSuccess: function(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'}], function(){
|
||||
$('#winGrup')
|
||||
.find('#butWSAll').click(function(){this.grup_semua();}.bind(this)).end()
|
||||
.find('#butWCAll').click(function(){this.grup_clear();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.grup_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_semua: function(){
|
||||
$('#tabGrupList').find('input:checkbox').prop('checked', true);
|
||||
},
|
||||
|
||||
grup_clear: function(){
|
||||
$('#tabGrupList').find('input:checkbox').prop('checked', false);
|
||||
},
|
||||
|
||||
grup_save: function(){
|
||||
var alist = [];
|
||||
$('#tabGrupList').find('input:checkbox:checked').each(function(){
|
||||
alist.push($(this).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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk').find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
$('#winBProduk').find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#Promo_InvID').val(acell[0]);
|
||||
$('#Promo_Produk').val(acell[2]);
|
||||
this.update_Items(acell[0], 0);
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Promo']
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_Items: function(InvID, SatuanID){
|
||||
$('#Promo_SatuanID').empty();
|
||||
if (InvID==0) return false;
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_item','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);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,118 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/barcode.js
|
||||
Desc. : JS - Cetak Barcode Label
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 28th, 2013.
|
||||
Last Modified : October 2nd, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBarcodeJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print();}.bind(this));
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': RepoBarcodeJS.Produk_Comp});
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
$('#butPL').click(function(){this.load_printer();}.bind(this));
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
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 cPRINTERPOS(this.PHP);
|
||||
cetak.setPrinter($('#Printer').val());
|
||||
cetak.add_param("data", "print-barcode");
|
||||
cetak.add_param("InvID");
|
||||
cetak.add_param("SatuanID");
|
||||
cetak.add_param("Qty");
|
||||
cetak.add_param("Kode_Sup");
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#SatuanID').val(acell[1]);
|
||||
$('#Kode_SKU').val(acell[2]);
|
||||
$('#Nama_Produk').val(acell[4]);
|
||||
this.update_Sup();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
var adata = item.data.split(':');
|
||||
$('#InvID').val(item.value);
|
||||
$('#SatuanID').val(adata[1]);
|
||||
$('#Kode_SKU').val(adata[0]);
|
||||
RepoBarcodeJS.update_Sup();
|
||||
FoniaJS.setFocus('#Qty');
|
||||
},
|
||||
|
||||
update_Sup: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=opt-sup','InvID']
|
||||
}).send();
|
||||
},
|
||||
|
||||
load_printer: function(){
|
||||
var parent = this;
|
||||
qz.printers.find().then(function(data){
|
||||
var _dafprt = '';
|
||||
for(var i = 0; i < data.length; i++) {
|
||||
_dafprt += data[i] + '|';
|
||||
};
|
||||
new Request.JSONF({
|
||||
url: parent.PHP,
|
||||
sendParam: ['data=load-printer','Printer='+_dafprt,'DefPrint='+$('#configPrinter').html()]
|
||||
}).send();
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/beli.js
|
||||
Desc. : JS - Laporan Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 12th, 2011.
|
||||
Last Modified : October 10th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBeliJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
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();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/beli_analisa.js
|
||||
Desc. : JS - Laporan Analisa Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : December 12th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBeliAnalisaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
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();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/beli_mutasi.js
|
||||
Desc. : JS - Laporan Mutasi Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 3rd, 2013.
|
||||
Last Modified : December 12th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBeliMutasiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/beli_retur.js
|
||||
Desc. : JS - Laporan Retur Pembelian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 12th, 2011.
|
||||
Last Modified : December 12th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoBeliReturJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/dana_pos.js
|
||||
Desc. : JS - Laporan Penerimaan Kasir / POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 8th, 2012.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoDanaPOSJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butPOS').click(function(){this.proses_pos();}.bind(this));
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_pos: function(){
|
||||
if ($('#KasirID').val()==0){
|
||||
FoniaJS.showError("Untuk Cetak POS silakan pilih salah satu Nama Pengguna!");
|
||||
$('#KasirID').focus();
|
||||
return;
|
||||
}
|
||||
var cetak = new cPRINTERPOS(this.PHP);
|
||||
cetak.add_param("data", "print-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 cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("KasirID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/hutang.js
|
||||
Desc. : JS - Laporan Hutang Supplier
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 17th, 2011.
|
||||
Last Modified : October 16th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoHutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/hutang_bayar.js
|
||||
Desc. : JS - Laporan Pembayaran Hutang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 18th, 2012.
|
||||
Last Modified : October 19th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoHutangBayarJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual.js
|
||||
Desc. : JS - Laporan Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : April 12th, 2011.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,50 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual_analisa.js
|
||||
Desc. : JS - Laporan Analisa Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 9th, 2013.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualAnaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("Tipe");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Urut");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual_margin.js
|
||||
Desc. : JS - Laporan Margin Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : October 12nd, 2012.
|
||||
Last Modified : December 12th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualMarginJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/jual_rekap.js
|
||||
Desc. : JS - Laporan Rekap Penjualan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 9th, 2013.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoJualRekapJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/kas_keluar.js
|
||||
Desc. : JS - Laporan Pengeluaran Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 18th, 2012.
|
||||
Last Modified : October 18th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoKasKeluarJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/kas_terima.js
|
||||
Desc. : JS - Laporan Penerimaan Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 18th, 2012.
|
||||
Last Modified : October 19th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoKasTerimaJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Tipe");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,160 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/label.js
|
||||
Desc. : JS - Cetak Label Harga Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 13th, 2014.
|
||||
Last Modified : October 5th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoLabelJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(q){//oke
|
||||
$('#butHapus').click(function(){this.proses_empty();}.bind(this));
|
||||
$('#butPrint').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
this.data_query('tabel-detail', 'empty', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
proses_empty: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=empty']
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_print: function(prt){//oke
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
produk_brow: function(){//oke
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winBProduk')
|
||||
.find('#butWSimpan').click(function(){this.produk_simpan();}.bind(this)).end()
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_simpan: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=simpan-produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
grup_brow: function(){//oke
|
||||
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"> </div>');
|
||||
this.winBGrup = FoniaJS.showWindow('BGrup', 'Daftar Grup Barang', _isi, 900, null, function(){
|
||||
$('#winBGrup')
|
||||
.find('#Cari_Grup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-grup');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-grup');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBGrup').find('#Cari_Grup').val('');
|
||||
this.data_query('brow-grup');
|
||||
}.bind(this));
|
||||
this.data_query('brow-grup');
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
grup_select: function(acell){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=simpan-grup','Grup_InvID='+acell[0]],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winBGrup);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){//oke
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-tx','mode_detail=update','ID='+acell[0]],
|
||||
onSuccess: function(a){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', a.html, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.detail_simpan();}.bind(this)).end()
|
||||
.find('#Nama_Produk').keyup(function(e){
|
||||
if (-1!==$.inArray(e.which, [13,9])) this.detail_simpan();
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Nama_Produk');
|
||||
}.bind(this), false);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){//oke
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail=delete','ID='+acell[0]]
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){//oke
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail','ID','Nama_Produk='+encodeURIComponent($('#Nama_Produk').val())],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){//oke
|
||||
if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-detail','mode_detail='+mode,'No_Label'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')]
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-grup"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-grup','Cari_Grup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/mutasi_cabang.js
|
||||
Desc. : JS - Laporan Mutasi Stok Cabang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 16th, 2011.
|
||||
Last Modified : December 13th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoMutasiCabJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("Cab1ID");
|
||||
dload.add_param("Cab2ID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,44 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/opname.js
|
||||
Desc. : JS - Laporan Opname Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 8th, 2012.
|
||||
Last Modified : October 4th, 2025.
|
||||
|
||||
(c) 2012 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoOpnameJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("KasirID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/rekap_harian.js
|
||||
Desc. : JS - Laporan Rekap Total Harian
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 25th, 2013.
|
||||
Last Modified : December 14th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoRekapHarianJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/rekap_margin.js
|
||||
Desc. : JS - Laporan Rekap Margin
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 5th, 2013.
|
||||
Last Modified : December 14th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoRekapMarginJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,42 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/rekap_modal.js
|
||||
Desc. : JS - Laporan Rekap Modal
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 19th, 2013.
|
||||
Last Modified : December 13th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoRekapModalJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("Tgl_From");
|
||||
dload.add_param("Tgl_To");
|
||||
dload.download();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,61 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/stok_akhir.js
|
||||
Desc. : JS - Laporan Stok Akhir Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : January 24th, 2011.
|
||||
Last Modified : October 1st, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoStokAkhirJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "print");
|
||||
cetak.add_param("CabID");
|
||||
cetak.add_param("SupID");
|
||||
cetak.add_param("Grup_InvID");
|
||||
cetak.add_param("Tanggal");
|
||||
cetak.add_param("Urut");
|
||||
cetak.add_param("Harga");
|
||||
cetak.add_param("Min_Stok");
|
||||
cetak.add_param("Min_Qty");
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
},
|
||||
|
||||
proses_dload: function(){
|
||||
var dload = new cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
dload.add_param("CabID");
|
||||
dload.add_param("SupID");
|
||||
dload.add_param("Grup_InvID");
|
||||
dload.add_param("Tanggal");
|
||||
dload.add_param("Urut");
|
||||
dload.add_param("Harga");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,100 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/repo/stok_mutasi.js
|
||||
Desc. : JS - Laporan Mutasi Stok Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 16th, 2011.
|
||||
Last Modified : October 2nd, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RepoStokMutasiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butCetak').click(function(){this.proses_print(true);}.bind(this));
|
||||
$('#butPreview').click(function(){this.proses_print();}.bind(this));
|
||||
$('#butExcel').click(function(){this.proses_dload();}.bind(this));
|
||||
FoniaJS.AutoComplete('#Nama_Produk', this.PHP, ['data=auto-produk'], {'selectFunc': RepoStokMutasiJS.Produk_Comp});
|
||||
$('#butBrow').click(function(){this.produk_brow();}.bind(this));
|
||||
$('#Nama_Produk').focus();
|
||||
},
|
||||
|
||||
proses_print: function(prt){
|
||||
if ($('#InvID').val()==0) {
|
||||
FoniaJS.showError('Silakan masukkan Nama Barang !');
|
||||
$('#Nama_Produk').focus();
|
||||
return;
|
||||
}
|
||||
var cetak = new cPRINTER(this.PHP);
|
||||
cetak.add_param("data", "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 cEXPORT(this.PHP);
|
||||
dload.add_param("data", "export");
|
||||
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"> </div>');
|
||||
this.winBProduk = FoniaJS.showWindow('BProduk', 'Daftar Barang', _isi, 900, '', function(){
|
||||
$('#winBProduk')
|
||||
.find('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butSearch').click(function(e){
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this)).end()
|
||||
.find('#butAll').click(function(){
|
||||
$('#winBProduk').find('#Cari_Produk').val('');
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
this.data_query('brow-produk');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
$('#InvID').val(acell[0]);
|
||||
$('#Nama_Produk').val(acell[3]);
|
||||
$('#Tgl_From').focus();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-produk','Cari_Produk'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
$('#InvID').val(item.value);
|
||||
$('#Tgl_From').focus();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,80 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/about.js
|
||||
Desc. : JS - Informasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : November 23th, 2011.
|
||||
Last Modified : May 1st, 2022.
|
||||
|
||||
(c) 2011 - 2022, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var AboutJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: 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.phpversion+'</p>');
|
||||
},
|
||||
|
||||
proses_checkdb: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_db'],
|
||||
onSuccess: function(txt){
|
||||
this.winCheck = FoniaJS.showWindow('CekDB', 'Cek, Perbaiki dan Optimalisasi Database', txt, 500, [{},{i:'butTutup'},{i:'butWProses',v:'Proses DB !',c:'success'}], function(){
|
||||
$('#winCekDB').find('#butWProses').click(function(){this.checkdb_run();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_update: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check_update'],
|
||||
onSuccess: function(txt){
|
||||
this.winUpdate = FoniaJS.showWindow('CekApp', 'Cek dan Update Aplikasi', txt, 500, [{},{i:'butTutup'},{i:'butWUpdate',v:'Proses Update !',c:'success'}], function(){
|
||||
$('#winCekApp').find('#butWUpdate').click(function(){this.update_run();}.bind(this));
|
||||
var tomb = $('#winCekApp').find('#butWUpdate');
|
||||
if ($('#file_online').val()==1){
|
||||
tomb.prop('disabled', false);
|
||||
} else {
|
||||
tomb.html('Telah Update!').prop('disabled', true);
|
||||
}
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
checkdb_run: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_db','DB_Cek','DB_Repair','DB_Opti'],
|
||||
onSuccess: function(txt){
|
||||
if ($('#DB_Hasil')) $('#DB_Hasil').removeClass('d-none').html(txt);
|
||||
FoniaJS.showInfo('Proses Database selesai', 2000);
|
||||
}
|
||||
}).send();
|
||||
},
|
||||
|
||||
update_run: function(){
|
||||
if ($('#file_online')){
|
||||
if ($('#file_online').val()==1){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=proses_update','file_web','file_sql','file_build'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.sukses==true) {
|
||||
FoniaJS.showInfo('Aplikasi telah di Update.<br>Silakan Log Out dari Aplikasi<br>Lalu refresh browser Anda!');
|
||||
} else {
|
||||
FoniaJS.showInfo('Aplikasi gagal di Update.');
|
||||
}
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,55 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/chpasswd.js
|
||||
Desc. : JS - Perubahan Password Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 7th, 2008.
|
||||
Last Modified : April 25th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SYSChpasswdJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butSave').click(function(){this.proses_save();}.bind(this));
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=chpasswd','LPass','BPass1','BPass2'],
|
||||
onSuccess: function(ajson){
|
||||
if (ajson.status == true) {
|
||||
FoniaJS.showInfo(ajson.msg);
|
||||
FoniaJS.closeWindow('#win'+this.KODE);
|
||||
} else {
|
||||
FoniaJS.showError(ajson.msg);
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,59 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/config.js
|
||||
Desc. : JS - Konfigurasi Aplikasi
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 25th, 2010.
|
||||
Last Modified : September 30th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var ConfigJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('view');
|
||||
},
|
||||
|
||||
proses_edit: function(){
|
||||
this.data_query('edit');
|
||||
},
|
||||
|
||||
proses_save: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode=save','REG_ID','REG_ADDRESS','REG_CITY','REG_POSTCODE','REG_PHONE','REG_FAX','REG_WEBSITE','REG_EMAIL','REG_OWNER','REG_NPWP'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
data_query: function(mode){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=master','mode='+mode,'REG_ID'],
|
||||
onSuccess: function(txt){
|
||||
$('#divMaster').html(txt);
|
||||
this.update_event();
|
||||
}.bind(this)
|
||||
}).send()
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$("#butUbah").prop('disabled', true);
|
||||
$("#butSimpan").prop('disabled', false);
|
||||
} else {
|
||||
$("#butUbah").prop('disabled', false);
|
||||
$("#butSimpan").prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,146 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/menu_grup.js
|
||||
Desc. : JS - Manajemen Data Grup Login Menu
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 8th, 2013.
|
||||
Last Modified : January 1st, 2026.
|
||||
|
||||
(c) 2013 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var MenuGrupJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Grup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Grup').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=grup-detail','mode='+mode,'Grup_MenuID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Grup Menu', txt, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','Grup_MenuID='+acell[0]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
this.data_query('detail');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','Grup_MenuID','Nama_Grup','Ket','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=menu','Grup_MenuID='+acell[0]],
|
||||
onSuccess: function(txt){
|
||||
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', txt, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winMenu')
|
||||
.find('#butWSelAll').click(function(){this.menu_ceksemua();}.bind(this)).end()
|
||||
.find('#butWClrAll').click(function(){this.menu_hapussemua();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.menu_simpan();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_cek: function(el){
|
||||
var t_modul = el.value, b_check = el.checked;
|
||||
$('#tabMenuList tbody input[type="checkbox"]').map(function(i, b){
|
||||
var t_menu = $(b);
|
||||
if (t_menu.hasClass(t_modul)) t_menu.prop('checked', b_check);
|
||||
});
|
||||
el.prop('checked', !b_check);
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
var alist = $('#R_MENU').val().split(',');
|
||||
$('#tabMenuList tbody input[type="checkbox"]:checked').map(function(i, b){
|
||||
alist.push($(b).val());
|
||||
});
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save-menu','Grup_MenuID','Menu='+alist.join()],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
|
||||
}
|
||||
FoniaJS.closeWindow(this.winMenu);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Grup']
|
||||
}).send()
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,189 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/operator.js
|
||||
Desc. : JS - Manajemen Data Pengguna
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : March 12th, 2008.
|
||||
Last Modified : January 1st, 2026.
|
||||
|
||||
(c) 2008 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var OperatorJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_User').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_User').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butFilter').click(function(){this.filter_show();}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_User');
|
||||
},
|
||||
|
||||
filter_show: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail_filter','Filter_Level'],
|
||||
onSuccess: function(txt){
|
||||
this.winFilter = FoniaJS.showWindow('FLevel', 'Filter Data Pengguna / Level', txt, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winFLevel').find('#butWSimpan').click(function(){this.filter_simpan();}.bind(this));
|
||||
$('#winFLevel').find('#Fi_Level').focus();
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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,
|
||||
sendParam: ['data=user-detail','mode='+mode,'UserID='+UserID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Informasi Pengguna', txt, 'lg', [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_check();}.bind(this));
|
||||
this.oc_Level();
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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]+"?", function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','UserID='+acell[0]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
this.data_query('detail');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_check: function(){
|
||||
if ($('#Username').val().toUpperCase()==$('#UserLama').val().toUpperCase()) {
|
||||
this.detail_save();
|
||||
return;
|
||||
}
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=user-check','Username'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.ada==true) {
|
||||
FoniaJS.showInfo("Username telah ada dalam sistem !");
|
||||
} else {
|
||||
this.detail_save();
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','UserID','Username','Nama','Posisi','Level','Password','Grup_MenuID','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_show: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=menu','UserID='+acell[0]],
|
||||
onSuccess: function(txt){
|
||||
this.winMenu = FoniaJS.showWindow('Menu', 'Hak Akses Modul', txt, 'lg', [{i:'butWSelAll',v:'Pilih Semua',c:'info'},{i:'butWClrAll',v:'Hapus Semua',c:'info'},{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winMenu')
|
||||
.find('#butWSelAll').click(function(){this.menu_ceksemua();}.bind(this)).end()
|
||||
.find('#butWClrAll').click(function(){this.menu_hapussemua();}.bind(this)).end()
|
||||
.find('#butWSimpan').click(function(){this.menu_simpan();}.bind(this)).end()
|
||||
.find('#tabMenuList thead input[type="checkbox"]:disabled').prop('indeterminate', true);
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
menu_cek: function(el){
|
||||
var t_modul = el.value, b_check = el.checked;
|
||||
$('#tabMenuList tbody input[type="checkbox"]').map(function(i, b){
|
||||
var t_menu = $(b);
|
||||
if (t_menu.hasClass(t_modul)) t_menu.prop('checked', b_check);
|
||||
});
|
||||
el.prop('checked', !b_check);
|
||||
},
|
||||
|
||||
menu_ceksemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled)').prop('checked', true);
|
||||
},
|
||||
|
||||
menu_hapussemua: function(){
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled)').prop('checked', false);
|
||||
},
|
||||
|
||||
menu_simpan: function(){
|
||||
var alist = $('#R_MENU').val().split(',');
|
||||
$('#tabMenuList tbody input[type="checkbox"]:not(:disabled):checked').map(function(i, b){
|
||||
alist.push($(b).val());
|
||||
});
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save-menu','UserID','Menu='+alist.join()],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses simpan data!');
|
||||
}
|
||||
FoniaJS.closeWindow(this.winMenu);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Filter_Level','Cari_User']
|
||||
}).send()
|
||||
}
|
||||
},
|
||||
|
||||
oc_Level: function(){
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/printer.js
|
||||
Desc. : JS - Konfigurasi Printer POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : August 4th, 2013.
|
||||
Last Modified : December 7th, 2025.
|
||||
|
||||
(c) 2013 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var PrinterJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butBrow').click(function(){this.cab_brow();}.bind(this));
|
||||
$('#butUbah').click(function(){this.proses_edit();}.bind(this));
|
||||
$('#butSimpan').click(function(){this.proses_save();}.bind(this));
|
||||
this.data_query('form-printer');
|
||||
},
|
||||
|
||||
cab_brow: function(){
|
||||
var _isi = new String('<div id="divBrowCab"> </div>');
|
||||
this.winBCab = FoniaJS.showWindow('BCab', 'Daftar Cabang', _isi, 'lg', '', function(){
|
||||
this.data_query('brow-cabang');
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=form-printer','mode='+mode,'REG_ID','PRINT_AUTO','PRINT_OPENCD','PRINT_AUTOCUT','PRINT_ROW','TITLE_END'],
|
||||
onSuccess: function(a){
|
||||
$('#divPrinter').html(a.html);
|
||||
$('#Nama_Cabang').val(a.Nama_Cabang);
|
||||
this.update_event();
|
||||
if (a.sukses) FoniaJS.showInfo('Konfigurasi printer sukses disimpan!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
} else if (tipe=='brow-cabang'){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=brow-cabang']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
update_event: function(){
|
||||
if ($.inArray($('#mode').val(), ['edit']) >= 0) {
|
||||
$('#butUbah').prop('disabled', true);
|
||||
$('#butSimpan').prop('disabled', false);
|
||||
} else {
|
||||
$('#butUbah').prop('disabled', false);
|
||||
$('#butSimpan').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,49 @@
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/js/sys/super.js
|
||||
Desc. : JS - Informasi Supervisi Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 11st, 2012.
|
||||
Last Modified : March 19th, 2023.
|
||||
|
||||
(c) 2012 - 2023, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SuperJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
AJ: null,
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
if ($('#divSuper').length == 1){
|
||||
SuperJS.AJ = setInterval(function(){
|
||||
SuperJS.data_query('detail');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
|
||||
detail_select: function(acell){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','USERID='+acell[0],'KODE='+acell[1],'REQ_SID='+acell[2],'REQ='+acell[7]],
|
||||
onSuccess: function(){
|
||||
this.data_query('detail');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail'],
|
||||
onSuccess: function(){
|
||||
if ($('#divSuper').length == 0) clearInterval(SuperJS.AJ);
|
||||
}
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/karyawan.js
|
||||
Desc. : JS - Tabel Master Karyawan
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 7th, 2015.
|
||||
Last Modified : October 8th, 2025.
|
||||
|
||||
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var KaryawanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Karya').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Karya').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Karya');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=karya-detail','mode_detail='+mode,'KaryaID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Data Karyawan', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','KaryaID='+acell[0],'Cari_Karya'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','KaryaID','Nama_Karya','Tgl_Masuk','Tgl_Keluar','Aktif','Cari_Karya'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Karya']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/merek.js
|
||||
Desc. : JS - Tabel Master Merek Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 19th, 2010.
|
||||
Last Modified : October 18th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var MerekJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Merek').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Merek').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Merek');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=merek-detail','mode_detail='+mode,'MerekID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Merek', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','MerekID='+acell[0],'Cari_Merek'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','MerekID','Kode_Merek','Nama_Merek','Aktif','Cari_Merek'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Merek']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,293 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/produk.js
|
||||
Desc. : JS - Tabel Master Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 19th, 2010.
|
||||
Last Modified : January 10th, 2026.
|
||||
|
||||
(c) 2010 - 2026, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var ProdukJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
$('#butFilter').click(function(){this.filter_show();}.bind(this));
|
||||
this.data_query('tabel-produk');
|
||||
$('#Cari_Produk').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('tabel-produk');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('tabel-produk');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Produk').val('');
|
||||
this.data_query('tabel-produk');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Produk');
|
||||
},
|
||||
|
||||
filter_show: function(){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-filter','Filter_Produk'],
|
||||
onSuccess: function(txt){
|
||||
this.winFilter = FoniaJS.showWindow('Filter', 'Filter Produk Sesuai Grup', txt, 400, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winFilter').find('#butWSimpan').click(function(){this.filter_simpan();}.bind(this));
|
||||
}.bind(this));
|
||||
$('#Fi_Produk').focus();
|
||||
}.bind(this)
|
||||
}).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.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-produk','mode='+mode,'InvID='+ID],
|
||||
onSuccess: function(ajson){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Barang', ajson.html, 'xl', [{},{i:'butWBtl',v:'Batal',c:'danger'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail')
|
||||
.find('#butWSimpan').click(function(){this.produk_simpan();}.bind(this)).end()
|
||||
.find('#butWBtl').click(function(){this.produk_batal();}.bind(this));
|
||||
this.data_query('tabel-kemasan');
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_restore: function(acell){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=restore-detail','InvID='+acell[0]],
|
||||
onSuccess: function(ajson){
|
||||
this.winBRest = FoniaJS.showWindow('BRest', 'Informasi Backup Barang', ajson.html, 'xl', [], function(){
|
||||
this.data_query('restore-tabel');
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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>', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=restore-proses','InvID','MD5Key='+acell[1]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
FoniaJS.showInfo('Sukses restore Data Barang ini!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses restore!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
produk_restore_form: function(acell, div){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=restore-form','InvID','MD5Key='+acell[1]],
|
||||
onSuccess: function(adata){
|
||||
$(div).html(adata.html);
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','InvID='+acell[0]],
|
||||
onSuccess: function(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!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
produk_simpan: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','InvID','Grup_InvID','MerekID','Nama_Produk='+encodeURIComponent($('#Nama_Produk').val()),'StokID','NormalID','Harga_Beli','Harga_Tambah','Stok_Min','Stok_Max','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
produk_batal: function(){
|
||||
if ($('#mode').val()=='add'){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan batalkan Penambahan Barang ?', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=cancel','InvID','mode_before=add'],
|
||||
onSuccess: function(){
|
||||
this.data_query('tabel-produk');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
return false;
|
||||
}
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan batalkan Perubahan Detail Barang ?', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=cancel','InvID'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
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','','SKU_BARU','',0,0,0,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();
|
||||
},
|
||||
|
||||
kemasan_form: function(acell, div){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail-kemasan','InvID','InvKemasanID='+acell[0],'Nama_Satuan='+$('#StokID').find(':selected').text()],
|
||||
onSuccess: function(adata){
|
||||
$(div).html(adata.html);
|
||||
$(div)
|
||||
.find('#butBatalKemasan').click(function(e){
|
||||
this.kemasan_batal();
|
||||
}.bind(this)).end()
|
||||
.find('#butSimpanKemasan').click(function(e){
|
||||
this.kemasan_check();
|
||||
}.bind(this));
|
||||
this.calc_Modal();
|
||||
this.calc_Harga(1);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
kemasan_del: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus <b>"'+acell[1]+'"</b> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-kemasan','mode','mode_detail=delete','InvID','InvKemasanID='+acell[0]],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
kemasan_save: function(){
|
||||
if ($('#Qty').val()==0){
|
||||
FoniaJS.showInfo('Mohon isi jumlah Qty / Kemasan !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-kemasan','mode','mode_detail=update','InvID','InvKemasanID','SatuanID','SatuanLamaID','Kode_Barcode','Qty','Harga_Jual'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Sukses menyimpan kemasan produk.');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
kemasan_check: function(){
|
||||
if ($('#SatuanID').val()==$('#SatuanLamaID').val()) {
|
||||
this.kemasan_save();
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=check-kemasan','InvID','SatuanID'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.ada==true) {
|
||||
FoniaJS.showInfo("Nama kemasan telah ada dalam sistem!");
|
||||
} else {
|
||||
this.kemasan_save();
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="tabel-produk"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-produk','Cari_Produk','Filter_Produk']
|
||||
}).send();
|
||||
} else if (tipe=="tabel-kemasan"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tabel-kemasan','mode','InvID']
|
||||
}).send();
|
||||
} else if (tipe=="restore-tabel"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=restore-tabel','InvID']
|
||||
}).send();
|
||||
}
|
||||
},
|
||||
|
||||
hitung_HPP: function(){
|
||||
$('#Harga_Pokok').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Beli').val()) + FoniaJS.StrToFloat($('#Harga_Tambah').val()), 0));
|
||||
},
|
||||
|
||||
calc_Modal: function(){
|
||||
$('#Harga_Modal').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Harga_Pokok').val()) * FoniaJS.StrToFloat($('#Qty').val())));
|
||||
this.calc_Harga(1);
|
||||
},
|
||||
|
||||
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 - hmodal) / harga * 100, 2));
|
||||
} else {
|
||||
$('#Harga_Jual').val(FoniaJS.FloatToStr(hmodal / (100 - pjual) * 100));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,106 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/produk_grup.js
|
||||
Desc. : JS - Tabel Master Grup Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : February 8th, 2011.
|
||||
Last Modified : October 5th, 2025.
|
||||
|
||||
(c) 2011 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var ProdukGrupJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Grup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Grup').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Grup');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=grup-detail','mode_detail='+mode,'Grup_InvID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Grup Barang', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_check();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','Grup_InvID='+acell[0],'Cari_Grup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_check: function(){
|
||||
var _kode = $('#Kode_Grup').val();
|
||||
if (!_kode.match(/^[0-9]+$/)) {
|
||||
FoniaJS.showError('Tolong pastikan kembali Kode Grup adalah angka !');
|
||||
FoniaJS.setFocus('#Kode_Grup');
|
||||
return;
|
||||
}
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=kode-check','Grup_InvID','Kode_Grup'],
|
||||
onSuccess: function(adata){
|
||||
if (adata.ada==true) {
|
||||
FoniaJS.showInfo('Kode Grup telah ada dalam sistem!');
|
||||
} else {
|
||||
this.detail_save();
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','Grup_InvID','Kode_Grup','Nama_Grup','Margin','Aktif','Cari_Grup'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Grup']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/rek_pos.js
|
||||
Desc. : JS - Tabel Master Jenis Pembayaran POS
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : September 9th, 2014.
|
||||
Last Modified : October 8th, 2025.
|
||||
|
||||
(c) 2014 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var RekPOSJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Kartu').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Kartu').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Kartu');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=kartu-detail','mode_detail='+mode,'KartuID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jenis Pembayaran POS', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','KartuID='+acell[0],'Cari_Kartu'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','KartuID','Kode_Kartu','Nama_Kartu','Aktif','Cari_Kartu'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Kartu']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/satuan.js
|
||||
Desc. : JS - Tabel Master Satuan Barang
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : May 19th, 2010.
|
||||
Last Modified : October 5th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SatuanJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Satuan').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Satuan').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Satuan');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=satuan-detail','mode_detail='+mode,'SatuanID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Satuan', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','SatuanID='+acell[0],'Cari_Satuan'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','SatuanID','Kode_Satuan','Nama_Satuan','Aktif','Cari_Satuan'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Satuan']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,96 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/supplier.js
|
||||
Desc. : JS - Tabel Master Supplier
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 7th, 2010.
|
||||
Last Modified : October 7th, 2025.
|
||||
|
||||
(c) 2010 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var SupplierJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_Sup').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_Sup').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_Sup');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=sup-detail','mode='+mode,'SupID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Supplier', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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 <b>"'+acell[2]+'"</b> ?', function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode=del','SupID='+acell[0]],
|
||||
onSuccess: function(adata){
|
||||
if (adata.status==true){
|
||||
this.data_query('detail');
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}else{
|
||||
FoniaJS.showInfo('Ada masalah dalam proses hapus data!');
|
||||
}
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSON({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=save','mode','SupID','Kode_Sup','Nama_Sup','Alamat_Sup','Kota_Sup','Telp_Sup','Email_Sup','Kontak_Sup','No_NPWP','No_NITKU','Aktif'],
|
||||
onSuccess: function(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);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_Sup']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
@@ -0,0 +1,86 @@
|
||||
/*******************************************************************
|
||||
|
||||
App. Name : INVENTORY AND SALES SYSTEMS
|
||||
Module : /apps/js/tab/tx_kas.js
|
||||
Desc. : JS - Tabel Master Jenis Transaksi Kas
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : July 7th, 2015.
|
||||
Last Modified : October 8th, 2025.
|
||||
|
||||
(c) 2015 - 2025, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
var TXKasJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
loading: function(){
|
||||
this.data_query('detail');
|
||||
$('#Cari_TX').keydown(function(e){
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butSearch').click(function(e){
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
$('#butAll').click(function(){
|
||||
$('#Cari_TX').val('');
|
||||
this.data_query('detail');
|
||||
}.bind(this));
|
||||
FoniaJS.setFocus('#Cari_TX');
|
||||
},
|
||||
|
||||
detail_show: function(mode, ID){
|
||||
new Request({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=tx-detail','mode_detail='+mode,'TXID='+ID],
|
||||
onSuccess: function(txt){
|
||||
this.winDetail = FoniaJS.showWindow('Detail', 'Detail Jenis Transaksi Kas', txt, 600, [{},{i:'butTutup'},{i:'butWSimpan',v:'Simpan',c:'success'}], function(){
|
||||
$('#winDetail').find('#butWSimpan').click(function(){this.detail_save();}.bind(this));
|
||||
}.bind(this));
|
||||
}.bind(this)
|
||||
}).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> ?', function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail=delete','TXID='+acell[0],'Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses hapus data sukses!');
|
||||
}.bind(this)
|
||||
}).send();
|
||||
}.bind(this), 'danger');
|
||||
},
|
||||
|
||||
detail_save: function(){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','mode_detail','TXID','Grup_TX','Kode_TX','Nama_TX','Aktif','Cari_TX'],
|
||||
onSuccess: function(){
|
||||
FoniaJS.showInfo('Proses simpan data sukses!');
|
||||
FoniaJS.closeWindow(this.winDetail);
|
||||
}.bind(this)
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
if (tipe=="detail"){
|
||||
new Request.JSONF({
|
||||
url: this.PHP,
|
||||
sendParam: ['data=detail','Cari_TX']
|
||||
}).send();
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user