function pPenerimaanWisuda() { var ds_carabyr = store_carabyr(); var ds_setbiayawisuda = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'kwitansiwisuda_controller/get_biaya_wisuda', method: 'POST' }), totalProperty: 'results', root: 'data', autoLoad: true, fields: [{ name: 'idsetbiayawisuda', },{ name: 'nmsetbiayawisuda', },{ name: 'idthnakademik', },{ name: 'biaya', }] }); var interval; var form_bp_general = new Ext.form.FormPanel({ id: 'form_bp_general', title: 'Penerimaan Pembayaran Wisuda', iconCls:'silk-money', labelAlign: 'right', labelWidth: 150, forceFit: true, frame: true, autoScroll: true, layout: { type: 'form', pack: 'center', align: 'center' }, tbar: [{ text: 'Baru', iconCls: 'silk-add', handler: function() { Ext.getCmp('setbiayawisuda').enable(); Ext.getCmp('btsimpan').enable(); Ext.getCmp('btcetak').disable(); Ext.getCmp('btbatal').disable(); form_bp_general.getForm().reset(); setTime(); } }, { text: 'Simpan', id:'btsimpan', name:'btsimpan', iconCls: 'silk-save', handler: function() { simpan(); } }, { text: 'Cetak', iconCls: 'silk-printer', id:'btcetak', name:'btcetak', disabled: true, handler: function() { cetak(); } }, { text: 'Batal', id:'btbatal', name:'btbatal', iconCls: 'silk-cancel', disabled: true, handler: function() { batal(); } }, { text: 'Cari Kuitansi', iconCls: 'silk-find', handler: function() { wLookupKuiWisuda(); } }], items: [{ xtype: 'fieldset', title: 'Kuitansi', items: [{ layout: 'column', border: false, items: [{ columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'textfield', fieldLabel: 'No Kuitansi', readOnly: true, id: 'nokuitansi', name: 'nokuitansi', width: 260, emptyText: "Auto Generate" },{ xtype: 'container', fieldLabel: 'Tgl. / Jam Kuitansi', layout: 'hbox', defaults: { hideLabel: 'true' }, items: [{ xtype: 'datefield', id: 'tglkuitansi', width: 130, name: 'tglkuitansi', value: new Date() },{ xtype: 'textfield', disabled: true, id: 'timekuitansi', name: 'timekuitansi', width: 130 }] }] }, { columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'combo', fieldLabel: 'Cara Bayar', id: 'carabayar', name: 'carabayar', valueField: 'idcarabyr', displayField: 'nmcarabyr', store: ds_carabyr, triggerAction: 'all', editable: false, submitValue: true, hiddenName: 'h_cara_bayar', typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width:170, listeners: { select: function() { } } }, { xtype: 'textfield', fieldLabel: 'No. Ref', id: 'noref', name: 'noref', width: 170, }] }] }] }, { xtype: 'fieldset', title: 'Mahasiswa', items: [{ layout: 'column', border: false, items: [{ columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'container', fieldLabel: 'NPM', layout: 'hbox', defaults: { hideLabel: 'true' }, items: [{ xtype: 'textfield', id: 'nimmhs', fieldLabel: 'NPM', width: 150, readOnly: true, emptyText: "NPM" }, { xtype: 'button', id: 'btnimmhs', iconCls: 'silk-find', margins: '0 0 0 6', width: 25, handler: function(){ wLookupMhsLulus(); } }] }, { xtype: 'textfield', fieldLabel: 'Nama Mahasiswa', id: 'namamhs', disabled: true, width: 300, }, { xtype: 'textfield', id: 'prodimhs', fieldLabel: 'Program Studi', width: 300, disabled: true, }] },{ columnWidth: .50, layout: 'form', border: false, items: [{ xtype: 'textfield', id: 'thmasukmhs', fieldLabel: 'Tahun Masuk', width: 100, disabled: true, }, { xtype: 'textfield', id: 'thlulusmhs', fieldLabel: 'Tahun Lulus', width: 100, disabled: true, }, { xtype: 'textfield', id: 'stmhs', fieldLabel: 'Status Aktivitas Mahasiswa', width: 150, disabled: true, }] }] }] }, { xtype: 'fieldset', title: 'Pembayaran', items: [{ xtype: 'combo', fieldLabel: 'Biaya Wisuda', id: 'setbiayawisuda', name: 'setbiayawisuda', valueField: 'idsetbiayawisuda', displayField: 'nmsetbiayawisuda', store: ds_setbiayawisuda, triggerAction: 'all', editable: false, submitValue: true, hiddenName: 'h_setbiayawisuda', typeAhead: true, mode: 'local', emptyText: 'Pilih...', selectOnFocus: true, width:350, listeners: { select: function(combo, record) { setBiayaWisuda(combo, record); } } }, { xtype: 'numericfield', style: 'text-align: right;', fieldLabel: 'Nominal', id: 'nominal', name: 'nominal', maskRe: /[0-9.]/, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', disabled: true, }, { xtype: 'textfield', fieldLabel: 'Terbilang', id: 'terbilang', width:350, name: 'terbilang', disabled: true, }, { xtype: 'numericfield', style: 'text-align: right;', fieldLabel: 'Jumlah Bayar', id: 'jmlbayar', maskRe: /[0-9.]/, name: 'jmlbayar', decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', validator: function(){ var terima = Ext.getCmp('jmlbayar').getValue(); var nominal = Ext.getCmp('nominal').getValue(); Ext.getCmp('kembalian').setValue(terima - nominal); }, }, { xtype: 'numericfield', style: 'text-align: right;', fieldLabel: 'Kembalian', id: 'kembalian', name: 'kembalian', disabled: true, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.' }] }], listeners: { afterrender: function(){ setTime(); } } }); SET_PAGE_CONTENT(form_bp_general); function setTime(){ interval = setInterval(function() { var d=new Date(); var t=d.toLocaleTimeString('en-US', { hour12: false }); if(Ext.getCmp('timekuitansi')) RH.setCompValue('timekuitansi',t); }, 1000); } function wLookupMhsLulus(){ var fields_grid = RH.storeFields('nim','nmmhs','kdjnskelamin','nmprodi', 'kdjenjangstudi','nmjenjangstudi','thnmasuk','thnkeluar','nmstaktivitasmhs'); var ds_grid = RH.JsonStore({ url : BASE_URL + 'kwitansiwisuda_controller/lookup_mhs_lulus', fields : fields_grid, limit: 20, enableSearch: true, }); var cm_grid = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { header: 'NPM', width: 100, align: 'center', dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 200, dataIndex: 'nmmhs', sortable: true }, { header: 'L/P', width: 60, align: 'center', dataIndex: 'kdjnskelamin', sortable: true }, { header: 'Program Studi', width: 200, dataIndex: 'nmprodi', sortable: true }, { header: 'Jenjang Studi', width: 100, align: 'center', dataIndex: 'nmjenjangstudi', sortable: true }, { header: 'Tahun Masuk', width: 80, align: 'center', dataIndex: 'thnmasuk', sortable: true }, { header: 'Tahun Lulus', width: 80, align: 'center', dataIndex: 'thnkeluar', sortable: true }, { header: 'Status Aktivitas Mahasiswa', width: 150, dataIndex: 'nmstaktivitasmhs', sortable: true }] ); //SEARCH OBJ var searchParObj = new Object([ { 'key': 'nim', 'name': 'NPM' } , { 'key': 'nmmhs', 'name': 'Nama Mahasiswa' } , { 'key': 'kdjnskelamin', 'name': 'L/P' } , { 'key': 'nmprodi', 'name': 'Program Studi' } , { 'key': 'nmjenjangstudi', 'name': 'Jenjang Studi' } , { 'key': 'thnmasuk', 'name': 'Tahun Masuk' } , { 'key': 'thnkeluar', 'name': 'Tahun Lulus' } , { 'key': 'nmstaktivitasmhs', 'name': 'Status Aktivitas Mahasiswa' } ]); RH.searchObj_init(); // MUST to INITIALIZE RH.searchObj.textWidth = 250; RH.searchObj.params = searchParObj; // MUST OVR RH.searchObj.store = ds_grid; // MUST OVR //GRID PANEL var gp_grid = new Ext.grid.GridPanel({ ds: ds_grid, cm: cm_grid, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true,//height: 400,width: 720, tbar:[RH.searchBar()], forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', bbar: new Ext.PagingToolbar({ store: ds_grid, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), /*listeners: { rowdblclick: on_dblclk_grid }*/ }); var winMhskeu = new Ext.Window({ title: 'Daftar Mahasiswa (LULUS)', modal: true, layout: 'fit', width:1030, height:400, items: [gp_grid] }); gp_grid.on('rowdblclick', function(grid, rowIdx){ var rec = gp_grid.store.getAt(rowIdx); RH.setCompValue('nimmhs', rec.data['nim']), RH.setCompValue('namamhs', rec.data['nmmhs']), RH.setCompValue('prodimhs', rec.data['nmprodi'] + ' (' + rec.data['nmjenjangstudi'] + ')'), RH.setCompValue('thmasukmhs', rec.data['thnmasuk']), RH.setCompValue('thlulusmhs', rec.data['thnkeluar']), RH.setCompValue('stmhs', rec.data['nmstaktivitasmhs']), winMhskeu.close(); }, this ); winMhskeu.show(); } function setBiayaWisuda(combo, record){ var a = record.data.biaya; Ext.getCmp('nominal').setValue(a); Ext.getCmp('terbilang').setValue(terbilang(a)); Ext.getCmp('jmlbayar').setValue(a); } function simpan() { if (!Ext.getCmp('carabayar').getValue()) { Ext.MessageBox.alert("Informasi", Ext.getCmp('carabayar').fieldLabel + " Harus Diisi"); return; } if (!Ext.getCmp('nimmhs').getValue()) { Ext.MessageBox.alert("Informasi", Ext.getCmp('nimmhs').fieldLabel + " Harus Diisi"); return; } if (!Ext.getCmp('setbiayawisuda').getValue()) { Ext.MessageBox.alert("Informasi", Ext.getCmp('setbiayawisuda').fieldLabel + " Harus Diisi"); return; } if (!Ext.getCmp('jmlbayar').getValue()) { Ext.MessageBox.alert("Informasi", Ext.getCmp('jmlbayar').fieldLabel + " Harus Diisi"); return; } var waitmsgsimpan = Ext.MessageBox.wait('Menyimpan Data...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'kwitansiwisuda_controller/simpan_kwiwisuda', method: 'POST', params:{ nokuiwisuda:Ext.getCmp('nokuitansi').getValue(), tglkuiwisuda:Ext.getCmp('tglkuitansi').getValue(), jamkuiwisuda:Ext.getCmp('timekuitansi').getValue(), idcarabyr:Ext.getCmp('carabayar').getValue(), noref:Ext.getCmp('noref').getValue(), nim:Ext.getCmp('nimmhs').getValue(), idsetbiayawisuda:Ext.getCmp('setbiayawisuda').getValue(), bayar:Ext.getCmp('jmlbayar').getValue(), useridinput:USERID, }, success: function(response) { waitmsgsimpan.hide(); var arrjson = Ext.decode(response.responseText); if (arrjson.success==true){ Ext.MessageBox.alert("Informasi", arrjson.message); Ext.getCmp("nokuitansi").setValue(arrjson.nokuiwisuda); Ext.getCmp('btsimpan').disable(); Ext.getCmp('btcetak').enable(); Ext.getCmp('btbatal').enable(); } else if (arrjson.success==false){ Ext.MessageBox.alert("Informasi", arrjson.message); } }, failure: function() { waitmsgsimpan.hide(); Ext.MessageBox.alert("Informasi", "Simpan Data Gagal"); } }); } function cetak() { var win = window.open(); win.location.reload(); win.location = BASE_URL + 'rpt/cetak_kuitansi/pcetak_kuitansiwisuda/' + RH.getCompValue('nokuitansi'); } function batal(){ var nokuiwisuda = RH.getCompValue('nokuitansi'); Ext.Msg.show({ title: "Konfirmasi", msg: "Anda yakin membatalkan kuitansi ini?
No. Kuitansi: " + nokuiwisuda, buttons: Ext.Msg.YESNO, fn: function(btn) { if (btn == 'yes') { var waitmsgbatal = Ext.MessageBox.wait('Membatalkan Kuitansi...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'kwitansiwisuda_controller/batal_kwiwisuda', method: 'POST', params:{ nokuiwisuda:nokuiwisuda, useridinput:USERID, }, success: function() { waitmsgbatal.hide(); Ext.MessageBox.alert("Informasi", "No. Kuitansi: " + nokuiwisuda + " Berhasil Dibatalkan"); Ext.getCmp('btsimpan').disable(); Ext.getCmp('btcetak').disable(); Ext.getCmp('btbatal').disable(); }, failure: function() { waitmsgbatal.hide(); Ext.MessageBox.alert("Informasi", "No. Kuitansi: " + nokuiwisuda + " Gagal Dibatalkan"); } }); } } }) } function wLookupKuiWisuda(){ var fields_grid = RH.storeFields('nokuiwisuda','tglkuiwisuda','jamkuiwisuda','idcarabyr','nmcarabyr','noref', 'nim','nmmhs','nmprodi','kdjenjangstudi','nmjenjangstudi','thnmasuk','thnkeluar','nmstaktivitasmhs','idsetbiayawisuda','nmsetbiayawisuda', 'biaya','bayar','tglinput','useridinput','usernameinput'); var ds_grid = RH.JsonStore({ url : BASE_URL + 'kwitansiwisuda_controller/lookup_kwiwisuda', fields : fields_grid, limit: 20, enableSearch: true, }); var cm_grid = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), { header: 'No. Kuitansi', width: 150, align: 'center', dataIndex: 'nokuiwisuda', sortable: true },{ header: 'Tgl. Kuitansi', width: 80, align: 'center', dataIndex: 'tglkuiwisuda', sortable: true },{ header: 'Jam Kuitansi', width: 100, align: 'left', dataIndex: 'jamkuiwisuda', sortable: true },{ header: 'Cara Bayar', width: 100, align: 'left', dataIndex: 'nmcarabyr', sortable: true },{ header: 'No. Ref', width: 100, align: 'left', dataIndex: 'noref', sortable: true },{ header: 'NPM', width: 100, align: 'center', dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 200, dataIndex: 'nmmhs', sortable: true }, { header: 'Biaya Wisuda', width: 250, dataIndex: 'nmsetbiayawisuda', sortable: true }, { header: 'Nominal', width: 100, dataIndex: 'biaya', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Jumlah Bayar', width: 100, dataIndex: 'bayar', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Tgl. Input', width: 80, align: 'center', dataIndex: 'tglinput', sortable: true }, { header: 'User Input', width: 100, dataIndex: 'usernameinput', sortable: true }] ); //SEARCH OBJ var searchParObj = new Object([ { 'key': 'nokuiwisuda', 'name': 'No. Kuitansi' } , { 'key': 'nim', 'name': 'NPM' } , { 'key': 'nmmhs', 'name': 'Nama Mahasiswa' } , { 'key': 'nmsetbiayawisuda', 'name': 'Biaya Wisuda' } ]); RH.searchObj_init(); // MUST to INITIALIZE RH.searchObj.textWidth = 250; RH.searchObj.params = searchParObj; // MUST OVR RH.searchObj.store = ds_grid; // MUST OVR //GRID PANEL var gp_grid = new Ext.grid.GridPanel({ ds: ds_grid, cm: cm_grid, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true,//height: 400,width: 720, tbar:[RH.searchBar()], forceFit: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', bbar: new Ext.PagingToolbar({ store: ds_grid, displayInfo: true, displayMsg: 'Data {0} - {1} dari {2}', emptyMsg: "Belum ada data", }), /*listeners: { rowdblclick: on_dblclk_grid }*/ }); var winKuiWisuda = new Ext.Window({ title: 'Daftar Kuitansi Wisuda', modal: true, layout: 'fit', width:930, height:400, items: [gp_grid] }); gp_grid.on('rowdblclick', function(grid, rowIdx){ var rec = gp_grid.store.getAt(rowIdx); RH.setCompValue('nokuitansi', rec.data['nokuiwisuda']), RH.setCompValue('tglkuitansi', rec.data['tglkuiwisuda']), RH.setCompValue('timekuitansi', rec.data['jamkuiwisuda']), RH.setCompValue('carabayar', rec.data['nmcarabyr']), RH.setCompValue('noref', rec.data['noref']), RH.setCompValue('nimmhs', rec.data['nim']), RH.setCompValue('namamhs', rec.data['nmmhs']), RH.setCompValue('prodimhs', rec.data['nmprodi'] + ' (' + rec.data['nmjenjangstudi'] + ')'), RH.setCompValue('thmasukmhs', rec.data['thnmasuk']), RH.setCompValue('thlulusmhs', rec.data['thnkeluar']), RH.setCompValue('stmhs', rec.data['nmstaktivitasmhs']), RH.setCompValue('setbiayawisuda', rec.data['idsetbiayawisuda']), RH.setCompValue('nominal', rec.data['biaya']), RH.setCompValue('terbilang', terbilang(rec.data['biaya'])), RH.setCompValue('jmlbayar', rec.data['bayar']), Ext.getCmp('setbiayawisuda').disable(); Ext.getCmp('btsimpan').disable(); Ext.getCmp('btcetak').enable(); Ext.getCmp('btbatal').enable(); clearInterval(interval); winKuiWisuda.close(); }, this ); winKuiWisuda.show(); } }