Files
glamore/apps/js/gel/keluar.js
T
2026-01-22 13:38:42 +07:00

83 lines
2.9 KiB
JavaScript

/*******************************************************************
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();
}
}
};