function pRptDPK(){ /** COMMON STORES */ var ds_years = store_tahun(); var ds_jkls = store_klsmhsplusall(); var ds_stsmt = store_stsmt(); var ds_persen = new Ext.data.JsonStore({ //from database proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'data_controller/get_set_tahapanbyr_dpk ', method: 'POST' }), autoLoad: true, root: 'data', fields: [ { name: "kdset", mapping: "kdset" } , { name: "nilai", mapping: "nilai" } ] }); var ds_operator = store_operator(); /** ==============================*/ var reader = new Ext.data.JsonReader({ root:'data', idProperty: '', totalProperty: 'results', remoteGroup: true, fields: [ { name: 'kdfakultas' } , { name: 'nmfakultas' } , { name: 'fakultas' } , { name: 'kdprodi' } , { name: 'nmprodi' } , { name: 'lnmprodi' } , { name: 'biaya' } , { name: 'jmlbayar' } , { name: 'persenbayar' } , { name: 'sisa' } , { name: 'persensisa' } , { name: 'diskon' } , { name: 'sukarela' } ] }); var ds_rptDPK = new Ext.data.GroupingStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'rptkeu_controller/get_DpkAllProdi', method: 'POST', }), /* baseParams: { thmasuk: RH.getCompValue('cb.thmasuk-dpk'), idklsmhs: RH.getCompValue('cb.jbayar-dpk') }, */ reader: reader, groupField:'fakultas', //sortInfo:{field:'kdfakultas',direction:'ASC'}, remoteSort: true, }); var cm_rptDPK = new Ext.grid.ColumnModel({ columns: [{ header: 'Fakultas/Program Studi', width: 205, dataIndex: 'fakultas', //sortable: true }, { header: 'Fakultas/Program Studi', width: 210, dataIndex: 'lnmprodi', //sortable: true }, { header: 'Biaya Tagihan', width: 100, dataIndex: 'biaya', xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Bayar', width: 100, dataIndex: 'jmlbayar', xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: '% Bayar', width: 100, dataIndex: 'persenbayar', xtype: 'numbercolumn', format:'0.%', align:'right' }, { header: 'Tunggakan', width: 100, dataIndex: 'sisa', xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: '% Tunggakan', width: 100, dataIndex: 'persensisa', xtype: 'numbercolumn', format:'0.%', align:'right' }, { header: 'Diskon', width: 100, dataIndex: 'diskon', xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Sukarela', width: 100, dataIndex: 'sukarela', xtype: 'numbercolumn', format:'0,000', align:'right' }] }); var cari_data_nya1 = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var gp_rptDPK = new Ext.grid.GridPanel({ id: 'gp.dpk-rpt', //title: 'Laporan per Mahasiswa', plugins: cari_data_nya1, ds: ds_rptDPK, cm: cm_rptDPK, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GroupingView({ forceFit:true, groupTextTpl: '{text} ({[values.rs.length]} {["Prodi"]})', enableGroupingMenu: false, // don't show a grouping menu enableNoGroups: false, // don't let the user ungroup hideGroupedColumn: true, // don't show the column that is being used to create the heading showGroupName: false, // don't show the field name with the group heading startCollapsed: false // the groups start closed/no }), tbar: [{hidden:false, text: 'Print', iconCls: 'silk-printer', handler: function(){ fnPrintDpk(); } }, '-', { xtype: 'button', id: 'btn_excel_dpkall', iconCls: 'silk-save', text: ' Export To Excel', handler: function() { exportdpkallprodi(); } },'->'], clicksToEdit: 1, //for cell editing (single click =1, dblclick=2) forceFit: true, //autoHeight: true, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', bbar: [{ xtype:'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Biaya Tagihan', id:'nf.to-biaya-dpk', readOnly: true, disabled: false, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Bayar', id:'nf.to-bayar-dpk', readOnly: true, disabled: false, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Tunggakan', id:'nf.to-tunggakan-dpk', readOnly: true, disabled: false, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Diskon', id:'nf.to-diskon-dpk', readOnly: true, disabled: false, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Sukarela', id:'nf.to-sukarela-dpk', readOnly: true, disabled: false, width:100, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }], listeners: { rowclick: onRowDpkClick } }); var ds_rptDPKdet = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'rptkeu_controller/get_DpkDet', method: 'POST' }), //baseParams: { nim:npm, kdprodi:kdprodi, thmasuk:thmasuk, idklsmhs:idklsmhs, persen:persen }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: "kdprodi" } , { name: "nim" } , { name: "nmmhs" } , { name: "biaya" } , { name: "jmlbayar" } , { name: "persenbayar" } , { name: "sisa" } , { name: "persensisa" } , { name: "stlunas" } , { name: "diskon" } , { name: "nmstawalmhs" } , { name: "nmstaktivitasmhs" } , { name: "nmklsmhs" } , { name: "biayapersmt" } , { name: "persenbayarper" } , { name: "sisaper" } , { name: "persensisaper" } , { name: "stlunasper" } ] }); var cari_data_nya = [new Ext.ux.grid.Search({ iconCls: 'btn_search', minChars: 1, autoFocus: true, autoHeight: true, position: 'top', mode: 'local', width: 200 })]; var cm_rptDPKdet = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer({width: 40}), { header: 'NPM', width: 100, dataIndex: 'nim', sortable: true }, { header: 'Nama Mahasiswa', width: 150, dataIndex: 'nmmhs', sortable: true }, { header: 'St.Masuk', width: 100, dataIndex: 'nmstawalmhs', sortable: true }, { header: 'St.Mahasiswa', width: 100, dataIndex: 'nmstaktivitasmhs', sortable: true }, { header: 'Kelas', width: 100, dataIndex: 'nmklsmhs', sortable: true },{ header: 'Biaya Tagihan
Saat Ini', width: 100, dataIndex: 'biayapersmt', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'center' }, { header: 'Bayar', width: 100, dataIndex: 'jmlbayar', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'center' }, { header: '% Bayar', width: 90, dataIndex: 'persenbayarper', sortable: true, xtype: 'numbercolumn', format:'0.%', align:'center' }, { header: 'Tunggakan', width: 100, dataIndex: 'sisaper', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'center' }, { header: '% Tunggakan', width: 90, dataIndex: 'persensisaper', sortable: true, xtype: 'numbercolumn', format:'0.%', align:'center' }, { header: 'St.Bayar Per.Smt', width: 100, dataIndex: 'stlunasper', sortable: true, }, { header: 'Diskon', width: 100, dataIndex: 'diskon', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'center' }] ); var gp_rptDPKdet = new Ext.grid.GridPanel({ id: 'gp.dpkdet-rpt', //title: 'Laporan per Mahasiswa', plugins: cari_data_nya, ds: ds_rptDPKdet, cm: cm_rptDPKdet, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), tbar: [{hidden:false, text: 'Print', iconCls: 'silk-printer', handler: function(){ var cmbopt1 = Ext.getCmp('cb.operator1-dpkdet').getValue(); var txtopt1 = Ext.getCmp('tf.persen1').getValue(); var cmbopt2 = Ext.getCmp('cb.operator2-dpkdet').getValue(); var txtopt2 = Ext.getCmp('tf.persen2').getValue(); if (cmbopt1) { if (!isNumeric(txtopt1)) { return; } } if (cmbopt2) { if (!isNumeric(txtopt2)) { return; } } fnPrintDetailDpk(); } }, '-', { xtype: 'button', id: 'btn_excel_dpkdet', iconCls: 'silk-save', text: ' Export To Excel', handler: function() { exportdpkdet(); } }, '-', { xtype: 'button', id: 'btn_excel_cms_dpkdet', iconCls: 'silk-save', text: ' Export As CMS', handler: function() { eksportascmsdpkdet(); } },'->'], clicksToEdit: 1, //for cell editing (single click =1, dblclick=2) forceFit: true, //autoHeight: true, autoScroll: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', bbar: [{ xtype:'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Biaya Tagihan', id:'nf.to-biaya-dpkdet', readOnly: true, disabled: false, width:80, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Bayar', id:'nf.to-bayar-dpkdet', readOnly: true, disabled: false, width:80, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Tunggakan', id:'nf.to-tunggakan-dpkdet', readOnly: true, disabled: false, width:80, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'numericfield', fieldLabel: 'Tot.Diskon', id:'nf.to-diskon-dpkdet', readOnly: true, disabled: false, width:80, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'textfield', fieldLabel: 'Tot.Lunas', id:'tf.to-mhs-bayar', readOnly: true, disabled: false, width:35, style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'textfield', fieldLabel: 'Tot.Blm Lunas', id:'tf.to-blm-bayar', readOnly: true, disabled: false, width:35, style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }, { xtype: 'form', border: false, items:[{ xtype: 'textfield', fieldLabel: 'Tot.Yg Sdh Byr', id:'tf.to-totmhs-bayar', readOnly: true, disabled: false, width:35, style : { //background : '#6699FF', fontSize : '13px', color : 'black', textAlign: 'right', } }] }], listeners: { rowclick: showRptDPKperMhs } }); //THE FORM PANEL var fpRptDPK = new Ext.Panel({ id: 'fp.RptDPK', title:'Laporan Keuangan DPK', layout: 'form', forceFit: true, maskDisabled: false, monitorValid: true, autoScroll: true, //width:500, height:400, margin: '0 0 10', frame: true, xtype: 'form', defaults: { labelWidth: 150, labelAlign: 'right'}, items: [ { xtype: 'fieldset', flex: 1, region:'north', layout:'column', autoHeight:true, items: [ { columnWidth:.3, layout: 'form', items: [ { xtype: 'combo', id: 'cb.thmasuk-dpk', fieldLabel: 'Th.Msk/Angkatan', store: ds_years, triggerAction: 'all', valueField: 'kode', displayField: 'nama', forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', //selectOnFocus:true, listeners:{ scope: this, 'select': function(){ var angkatan = parseInt(RH.getCompValue('cb.thmasuk-dpk')); //merubah ke int var tambah = angkatan + 1; var thnakademik = angkatan + '/' + tambah; RH.setCompValue('tf.thnaka-dpk',thnakademik); smtskrg(); jmlthp(); setGridDPK(); //setGridDPKdet(); } } }, { xtype: 'combo', id: 'cb.jkelas-dpk', fieldLabel: 'Jenis Kelas', store: ds_jkls, valueField: 'idklsmhs', displayField: 'kdnm', triggerAction: 'all',editable: false, forceSelection: true, submitValue: true, mode: 'local', emptyText:'Pilih...', //selectOnFocus:true, listeners:{ scope: this, 'select': function(){ setGridDPK(); }//setGridDPKdet();} } }, ] },{ columnWidth:.3, layout: 'form', items: [{ xtype: 'textfield', disabled:false, readOnly:true, width: 80, id: 'tf.thnaka-dpk', fieldLabel: 'Th.Akademik-Smt', }, { xtype: 'textfield', disabled:false, readOnly:true, width: 80, id: 'tf.smts-skrg', fieldLabel: 'Semester', }] },{ columnWidth:.3, layout: 'form', items: [{ xtype: 'textfield', disabled:false, readOnly:true, width: 80, id: 'tf.jml-thp', fieldLabel: 'Jml.Tahapan', }, { xtype: 'numericfield', fieldLabel: 'Jml.Biaya Thpn', id:'tf.jml-biaya-perthp', readOnly: true, disabled: false, //width:80, decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }] } ] }, { region: 'center', layout:'form', autoScroll:true, items:[{ xtype: 'panel', layout:'fit', height:350, //width: 1300, title:'Laporan Per Fakultas/Program Studi', id:'fp.dpk-fakultas', frame:true, items: [gp_rptDPK] }] }, RH.vSpacer(10), { items: [{ xtype: 'fieldset', flex: 1, region:'north', layout:'column', autoHeight:true,// margin:'5px 5px 5px 5px', items: [ { columnWidth:.50, layout: 'form', items: [ { xtype: 'combo', emptyText:'Pilih...', id: 'cb.persen-dpkdet', fieldLabel: 'Tahapan % Bayar', store: ds_persen, valueField: 'nilai', displayField: 'kdset', triggerAction: 'all',editable: false, hidden:true, forceSelection: true, submitValue: true, mode: 'local', listeners:{ scope: this, 'select': function(){ }//setGridDPKdet();} } }, { xtype:'compositefield', id:'cmpopt', items:[{ xtype: 'combo', emptyText:'Pilih', id: 'cb.operator1-dpkdet', fieldLabel: 'Tahapan % Bayar', store: ds_operator, valueField: 'kodeopt', displayField: 'kodeopt', triggerAction: 'all',editable: false, width:50, forceSelection: true, submitValue: true, mode: 'local', listeners:{ scope: this, 'select': function(){ } } },{ xtype: 'textfield', width:30, id: 'tf.persen1', fieldLabel: '', maskRe: /[0-9.]/, },{ xtype: 'label', text: '-', id: 'condlabel', width: 25, },{ xtype: 'combo', emptyText:'Pilih', id: 'cb.operator2-dpkdet', fieldLabel: '', store: ds_operator, valueField: 'kodeopt', displayField: 'kodeopt', triggerAction: 'all',editable: false, width:50, forceSelection: true, submitValue: true, mode: 'local', listeners:{ scope: this, 'select': function(){ AndOr(); } } },{ xtype: 'textfield', width:30, id: 'tf.persen2', fieldLabel: '', maskRe: /[0-9.]/, },{ xtype: 'button', iconCls: 'silk-find', id: 'btn_caridpkdet', width: 3, handler: function() { var cmbopt1 = Ext.getCmp('cb.operator1-dpkdet').getValue(); var txtopt1 = Ext.getCmp('tf.persen1').getValue(); var cmbopt2 = Ext.getCmp('cb.operator2-dpkdet').getValue(); var txtopt2 = Ext.getCmp('tf.persen2').getValue(); if (cmbopt1) { if (!isNumeric(txtopt1)) { return; } } if (cmbopt2) { if (!isNumeric(txtopt2)) { return; } } //alert('aaa'); setGridDPKdet(cmbopt1,txtopt1,cmbopt2,txtopt2); } }] } ] },{ columnWidth:.50, layout: 'form', items: [ { xtype: 'textfield', width:325, disabled:false, readOnly:true, id: 'tf.prodi-dpkdet', fieldLabel: 'Program Studi', }, { xtype: 'textfield', width:50, disabled:false, readOnly:true, id: 'tf.jml-mhs-dpk', fieldLabel: 'Jml.Mahasiswa', }, { xtype: 'textfield', disabled:false, readOnly:true, hidden: true, id: 'tf.thnmsk-dpkdet', fieldLabel: 'Tahun Masuk/Angkatan', }, { xtype: 'hidden', id: 'hf.kdprodi-dpkdet', //FOR STORING kdprodi } ] } ] }] }, { region: 'center', layout:'form', autoScroll:true, items:[{ xtype: 'panel', layout:'fit', height:350, title:'Laporan Per Mahasiswa', id:'fp.dpk-mahasiswa', frame:true, items: [gp_rptDPKdet] }], } ] }); SET_PAGE_CONTENT(fpRptDPK); function isNumeric(n) { return !isNaN(parseFloat(n)) && isFinite(n); } function AndOr() { var cmbopt1 = Ext.getCmp('cb.operator1-dpkdet').getValue(); var cmbopt2 = Ext.getCmp('cb.operator2-dpkdet').getValue(); var cond = ''; var labelcond = Ext.getCmp('condlabel'); if (cmbopt1 && cmbopt2) { if (cmbopt1 == '<>' && cmbopt2 == '<>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<>' && cmbopt2 == '>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<>' && cmbopt2 == '>=') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<>' && cmbopt2 == '<') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<>' && cmbopt2 == '<=') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>' && cmbopt2 == '<>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>' && cmbopt2 == '>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>' && cmbopt2 == '>=') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>' && cmbopt2 == '<') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>' && cmbopt2 == '<=') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>=' && cmbopt2 == '<>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>=' && cmbopt2 == '<') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '>=' && cmbopt2 == '<=') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<' && cmbopt2 == '<>') { cond = 'AND'; labelcond.setText('AND'); } else if (cmbopt1 == '<=' && cmbopt2 == '<>') { cond = 'AND'; labelcond.setText('AND'); } else { cond = 'OR'; labelcond.setText('OR'); } } else { cond = '-'; labelcond.setText('-'); } return cond } function smtskrg(){ var thnmsk = Ext.getCmp('cb.thmasuk-dpk').getValue() + 1; Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_smstskrg', method: 'POST', params :{ tahunangkatan: thnmsk }, scope: this, async:false, success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 var dataArray = jsonData.data; var data = dataArray[0]; RH.setCompValue('tf.smts-skrg', data.semester); } }); } function jmlthp(){ var thnmsk = Ext.getCmp('cb.thmasuk-dpk').getValue(); Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_jmlthp', method: 'POST', params :{ tahunangkatan: thnmsk }, scope: this, async:false, success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 var dataArray = jsonData.data; var data = dataArray[0]; RH.setCompValue('tf.jml-thp', data.jmlthpn); RH.setCompValue('tf.jml-biaya-perthp', data.jmlbiaya); } }); } function setGridDPK(){ if(RH.isEmpty('cb.thmasuk-dpk')) return; if(RH.isEmpty('cb.jkelas-dpk')) return; var thmasuk = RH.getCompValue('cb.thmasuk-dpk'); var idklsmhs = RH.getCompValue('cb.jkelas-dpk'); //Ext.Msg.alert("DEBUG", thmasuk + '-' + idklsmhs);return; ds_rptDPK.reload({ params: { thmasuk: thmasuk, idklsmhs: idklsmhs }, callback: function(results){ RH.setCompValue('nf.to-biaya-dpk', RH.sumRecVal(ds_rptDPK, 'biaya')); RH.setCompValue('nf.to-bayar-dpk', RH.sumRecVal(ds_rptDPK, 'jmlbayar')); RH.setCompValue('nf.to-tunggakan-dpk', RH.sumRecVal(ds_rptDPK, 'sisa')); RH.setCompValue('nf.to-diskon-dpk', RH.sumRecVal(ds_rptDPK, 'diskon')); RH.setCompValue('nf.to-sukarela-dpk', RH.sumRecVal(ds_rptDPK, 'sukarela')); } }); } function onRowDpkClick(grid, rowIdx){ //Ext.Msg.alert("Info", "Pilih Tahapan % Bayar");return; var record = ds_rptDPK.getAt(rowIdx); var thmasuk = Ext.getCmp('cb.thmasuk-dpk').getRawValue(); var idklsmhs = Ext.getCmp('cb.jkelas-dpk').getRawValue(); RH.setCompValue('tf.thnmsk-dpkdet',thmasuk); //RH.setCompValue('tf.jkls-dpkdet',idklsmhs); RH.setCompValue('tf.prodi-dpkdet',record.data['lnmprodi']); RH.setCompValue('hf.kdprodi-dpkdet',record.data['kdprodi']); jmlmhs(); setGridDPKdet('>=',0,null,null); Ext.getCmp('cb.operator1-dpkdet').setValue('>='); Ext.getCmp('tf.persen1').setValue(0); Ext.getCmp('cb.operator2-dpkdet').setValue(''); Ext.getCmp('tf.persen2').setValue(null); } function jmlmhs(){ var thnmsk = Ext.getCmp('cb.thmasuk-dpk').getValue(); var kdprodi = Ext.getCmp('hf.kdprodi-dpkdet').getValue(); Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_jmlmhsdpk', method: 'POST', params :{ tahunangkatan: thnmsk, kdprodi: kdprodi }, scope: this, async:false, success: function(result){ var jsonData = Ext.decode(result.responseText); //bisa utk Ext3 dan Ext4 var dataArray = jsonData.data; var data = dataArray[0]; RH.setCompValue('tf.jml-mhs-dpk', data.jummhsdpk); } }); } function fnPrintDpk(){ var thnmasuk = RH.getCompValue('cb.thmasuk-dpk'); var jenis_kelas = RH.getCompValue('cb.jkelas-dpk'); if(thnmasuk && jenis_kelas){ RH.ShowReport(BASE_URL + 'rpt/rpt_dpk/get_dpk/'+thnmasuk+'/'+jenis_kelas); } else {} } function fnPrintDetailDpk(){ var addslash1 = ''; var addslash = Ext.getCmp('cb.persen-dpkdet').getRawValue(); for (i=0;i'){ kondisi1 = 2; }else if(kondisi1 == '>'){ kondisi1 = 3; }else if(kondisi1 == '>='){ kondisi1 = 4; }else if(kondisi1 == '<'){ kondisi1 = 5; }else if(kondisi1 == '<='){ kondisi1 = 6; } //encrip kondisi2 if(kondisi2 == '='){ kondisi2 = 1; }else if(kondisi1 == '<>'){ kondisi2 = 2; }else if(kondisi2 == '>'){ kondisi2 = 3; }else if(kondisi2 == '>='){ kondisi2 = 4; }else if(kondisi2 == '<'){ kondisi2 = 5; }else if(kondisi2 == '<='){ kondisi2 = 6; } var opt = AndOr(); if(kdprodi) { RH.ShowReport(BASE_URL + 'rpt/rpt_det_dpk/get_det_dpk/'+thnmasuk+'/'+jns_kelas+'/'+kdprodi+'/'+persen1+'/'+kondisi1+'/'+persen2+'/'+kondisi2+'/'+opt); } else {} } function setGridDPKdet(cmbopt1,txtopt1,cmbopt2,txtopt2){ if(RH.isEmpty('cb.thmasuk-dpk')) return; if(RH.isEmpty('cb.jkelas-dpk')) return; if(RH.isEmpty('hf.kdprodi-dpkdet')) return; //the key var kdprodi = RH.getCompValue('hf.kdprodi-dpkdet'); //initialize RH.setCompValue('tf.to-mhs-bayar', 0); RH.setCompValue('nf.to-biaya-dpkdet', 0); RH.setCompValue('nf.to-bayar-dpkdet', 0); RH.setCompValue('nf.to-tunggakan-dpkdet', 0); RH.setCompValue('nf.to-diskon-dpkdet', 0); /* var record = RH.getRecAtVal(gp_rptDPK.getStore(), 'kdprodi', kdprodi); if (record != null) { RH.setCompValue('nf.to-biaya-dpkdet', record.data['biaya']); RH.setCompValue('nf.to-bayar-dpkdet', record.data['jmlbayar']); RH.setCompValue('nf.to-tunggakan-dpkdet', record.data['sisa']); } */ var addslash1 = ''; var addslash = Ext.getCmp('cb.persen-dpkdet').getRawValue(); for (i=0;i 0) { count2 = count2 + 1; } }); RH.setCompValue('tf.to-mhs-bayar', count); RH.setCompValue('tf.to-blm-bayar', count1); RH.setCompValue('tf.to-totmhs-bayar', count2); RH.setCompValue('nf.to-biaya-dpkdet', RH.sumRecVal(ds_rptDPKdet, 'biaya')); RH.setCompValue('nf.to-bayar-dpkdet', RH.sumRecVal(ds_rptDPKdet, 'jmlbayar')); RH.setCompValue('nf.to-tunggakan-dpkdet', RH.sumRecVal(ds_rptDPKdet, 'sisa')); RH.setCompValue('nf.to-diskon-dpkdet', RH.sumRecVal(ds_rptDPKdet, 'diskon')); } }); } //excel function exportdpkallprodi(){ var tablename = 'excel_dpk_all_prodi'; var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info'); var thmasuk = RH.getCompValue('cb.thmasuk-dpk'); var idklsmhs = RH.getCompValue('cb.jkelas-dpk'); var thmasuk = Ext.getCmp('cb.thmasuk-dpk').getValue(); var idklsmhs = Ext.getCmp('cb.jkelas-dpk').getValue(); if(thmasuk && idklsmhs){ Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_DpkAllProdiExcel', params: { thmasuk: thmasuk, idklsmhs: idklsmhs }, success: function() { waitmsgexport.hide(); window.location = BASE_URL + 'rptkeu_controller/export_excel/'+tablename; }, failure: function() { waitmsgexport.hide(); Ext.MessageBox.alert("Info", "Export Data Gagal"); } }); }else{ Ext.MessageBox.alert("Info", "Thn.Masuk atau Jenis Kelas kosong"); } } function exportdpkdet(){ var cmbopt1 = Ext.getCmp('cb.operator1-dpkdet').getValue(); var txtopt1 = Ext.getCmp('tf.persen1').getValue(); var cmbopt2 = Ext.getCmp('cb.operator2-dpkdet').getValue(); var txtopt2 = Ext.getCmp('tf.persen2').getValue(); var tablename = 'excel_dpk_det'; var thmasuk = Ext.getCmp('cb.thmasuk-dpk').getValue(); var idklsmhs = Ext.getCmp('cb.jkelas-dpk').getValue(); var prodi = (RH.getCompValue('hf.kdprodi-dpkdet')) ? RH.getCompValue('hf.kdprodi-dpkdet'):'-'; var isAllProdi = ""; if (!thmasuk) { Ext.MessageBox.alert("Info", "Pilih Thn.Masuk"); return; } else if (!idklsmhs){ Ext.MessageBox.alert("Info", "Pilih Jenis Kelas"); return; } else if (!cmbopt1 || !isNumeric(txtopt1)){ Ext.MessageBox.alert("Info", "Pilih Tahapan % Bayar Pertama"); return; } else { Ext.MessageBox.show({ title: "Konfirmasi", msg: "Cetak Seluruh Prodi?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { isAllProdi = "1"; } else if (btn == 'no') { if (prodi=='-'){ Ext.MessageBox.alert("Info", "Pilih Program Studi"); return; } else { isAllProdi = "0"; } } if (isAllProdi) { var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info'); Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_DpkDetExcel', params: { thmasuk: RH.getCompValue('cb.thmasuk-dpk'), idklsmhs: RH.getCompValue('cb.jkelas-dpk'), kdprodi: RH.getCompValue('hf.kdprodi-dpkdet'), persen1: txtopt1, kondisi1: cmbopt1, persen2: txtopt2, kondisi2: cmbopt2, start: 0, limit: 20, isallprodi:isAllProdi }, success: function() { waitmsgexport.hide(); window.location = BASE_URL + 'rptkeu_controller/export_excel/'+tablename; }, failure: function() { waitmsgexport.hide(); Ext.MessageBox.alert("Info", "Export Data Gagal"); } }); } } }); } } function eksportascmsdpkdet() { var kdprodi = (RH.getCompValue('hf.kdprodi-dpkdet')) ? RH.getCompValue('hf.kdprodi-dpkdet'):'-'; var nmprodi = RH.getCompValue('tf.prodi-dpkdet'); var thmasuk = Ext.getCmp('cb.thmasuk-dpk').getValue(); var klsmhs = RH.getCompValue('cb.jkelas-dpk'); var isAllProdi = ""; if (!thmasuk) { Ext.MessageBox.alert("Info", "Pilih Thn.Masuk"); return; } else if (!klsmhs){ Ext.MessageBox.alert("Info", "Pilih Jenis Kelas"); return; } var form_bp_general = new Ext.form.FormPanel({ border: false, id: 'form_bp_general', labelAlign: 'left', buttonAlign: 'right', bodyStyle: 'padding:10px 3px 3px 5px', // atas, kanan, bawah, kiri monitorValid: true, height: 150, width: 500, layout: 'form', items: [{ xtype: 'textfield', fieldLabel: 'Program Studi', id: 'prodiselect', width: 350, disabled:true },{ xtype: 'textfield', fieldLabel: 'No. Briva', id: 'nobriva', width: 150, },{ xtype: 'textfield', fieldLabel: 'Kode Biaya', id: 'kodebiaya', width: 150, }], buttons: [{ id:'btn_simpan', text: 'Lanjut Export As CMS', iconCls: 'silk-save', handler: function() { var nobriva = RH.getCompValue('nobriva'); var kodebiaya = RH.getCompValue('kodebiaya'); if (!nobriva || !kodebiaya) { Ext.MessageBox.alert("Info", "Silahkan Input Kode"); return; } window.location = BASE_URL + 'rptkeu_controller/exportascmsdpk/'+thmasuk+'/'+klsmhs+'/'+ kdprodi+'/'+isAllProdi+'/'+nobriva+'/'+kodebiaya; } }, { text: 'Kembali', iconCls:'silk-arrow-undo', handler: function() { win.close(); } } ] }); var win = new Ext.Window({ //tampilkan window input kode title: 'Input Kode', modal: true, items: [form_bp_general], resizable: false, }); Ext.MessageBox.show({ title: "Konfirmasi", msg: "Cetak Seluruh Prodi?", buttons: Ext.MessageBox.YESNO, fn: function(btn) { if (btn == 'yes') { isAllProdi = "1"; nmprodi = 'SELURUH PROGRAM STUDI' } else if (btn == 'no') { if (kdprodi=='-'){ Ext.MessageBox.alert("Info", "Pilih Program Studi"); return; } else { isAllProdi = "0"; } } if (isAllProdi) { Ext.getCmp('prodiselect').setValue(nmprodi); win.show(); } } }); } function showRptDPKperMhs(grid, rowIdx){ var record = ds_rptDPKdet.getAt(rowIdx); /** ==============================*/ //var tahun1 = parseInt(RH.getCompValue('tf.thnmsk-dpkdet')); //merubah ke int //var tahun2 = tahun1 + 1; //menjumlahkan bilangan int //---masukkan ke header kolom 1---// //var thnsmster1 = RH.getRecordFieldValue(ds_stsmt, 'nmsmt', 'kdstsemester', String(tahun1) + 1); //--------------------------------// //---masukkan ke header kolom 2---// //var thnsmster2 = RH.getRecordFieldValue(ds_stsmt, 'nmsmt', 'kdstsemester', String(tahun1) + 2); //--------------------------------// //---masukkan ke header kolom 3---// //var thnsmster3 = RH.getRecordFieldValue(ds_stsmt, 'nmsmt', 'kdstsemester', String(tahun2) + 1); //--------------------------------// //---masukkan ke header kolom 4---// //var thnsmster4 = RH.getRecordFieldValue(ds_stsmt, 'nmsmt', 'kdstsemester', String(tahun2) + 2); //--------------------------------// var ds_rptDPKperMhs = new Ext.data.JsonStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'rptkeu_controller/get_DpkPerMhs', method: 'POST', }), baseParams: { nim:record.data['nim'], /* thnmasuk:RH.getCompValue('tf.thnmsk-dpkdet'), jumlah:record.data['jmlbayar'], tunggakan:record.data['biaya'], stbayar:record.data['stlunas'], diskon:record.data['diskon'], sisa:record.data['sisa'], */ }, totalProperty: 'results', autoLoad : true, root: 'data', fields: [ { name: 'nokuitansi' } , { name: 'nmjnsbiaya' } , { name: 'nim' } , { name: 'nmthnakademik' } , { name: 'jmlbayar' } , { name: 'tglkuitansi' } , { name: 'nmcarabyr' } ] }); /* ds_rptDPKperMhs.reload({ callback: function(results){ RH.setCompValue('id-bayar', RH.sumRecVal(ds_rptDPKperMhs, 'jmlbayar')); } }); */ var cm_rptDPKperMhs = new Ext.grid.ColumnModel({ columns: [ { header: 'Tahun Akademik-Semester', width: 200, dataIndex: 'nmthnakademik', sortable: true }, { header: 'Jenis Biaya', width: 250, dataIndex: 'nmjnsbiaya', sortable: true }, { header: 'No.Kuitansi', width: 200, dataIndex: 'nokuitansi', sortable: true }, { header: 'Tanggal Kuitansi', width: 200, dataIndex: 'tglkuitansi', sortable: true }, { header: 'Bayar', width: 100, dataIndex: 'jmlbayar', sortable: true, xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Cara Bayar', width: 200, dataIndex: 'nmcarabyr', sortable: true }] }); var gp_rptDPKperMhs = new Ext.grid.GridPanel({ id: 'gp.dpk-rpt-mhs', ds: ds_rptDPKperMhs, cm: cm_rptDPKperMhs, sm: new Ext.grid.RowSelectionModel({ singleSelect: true}), view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}), forceFit: true, frame:true, autoScroll: true, autoWidth: true, autoSizeColumns: true, enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor', clicksToEdit: 1, height: 150, }); // -- FORM PANEL (DISPLAY) DETAIL DPP var fprptDPKperMhs = new Ext.form.FormPanel({ id: 'fp.DPKshow', layout: 'form', forceFit: true, maskDisabled: false, monitorValid: true, autoScroll: true, margin: '0 0 10', frame: true, //defaults: { labelWidth: 250, labelAlign: 'right'}, items: [{ xtype: 'fieldset', items: [{ layout:'column', items:[{ columnWidth:.4, layout: 'form', items: [{ id: 'npm', fieldLabel: 'NPM', value:record.data['nim'], xtype: 'textfield', disabled:false, readOnly:true, }, { id: 'nmmhs', fieldLabel: 'Nama Mahasiswa', value:record.data['nmmhs'], width: 250, xtype: 'textfield', disabled:false, readOnly:true, }, { id: 'prodi', fieldLabel: 'Program Studi', width: 325, value: RH.getCompValue('tf.prodi-dpkdet'), xtype: 'textfield', disabled:false, readOnly:true, }, { id: 'idkelas', fieldLabel: 'Kelas', width: 250, value: record.data['nmklsmhs'], xtype: 'textfield', disabled:false, readOnly:true, }] },{ columnWidth:.3, layout: 'form', items: [{ id: 'thnmasuk', fieldLabel: 'Tahun Masuk', width: 50, value: RH.getCompValue('tf.thnmsk-dpkdet'), xtype: 'textfield', disabled:false, readOnly:true, }, { id: '', fieldLabel: 'Status Masuk', width: 100, value:record.data['nmstawalmhs'], xtype: 'textfield', disabled:false, readOnly:true, }, { id: '', fieldLabel: 'Status Mahasiswa', width: 200, value:record.data['nmstaktivitasmhs'], xtype: 'textfield', disabled:false, readOnly:true, }] },{ columnWidth:.3, layout: 'form', items: [{ xtype: 'numericfield', fieldLabel: 'Diskon DPK', id:'iddiskon', readOnly: true, disabled: false, value: record.data['diskon'], decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }, { xtype: 'numericfield', fieldLabel: 'Tagihan DPK', id:'id-biaya', readOnly: true, disabled: false, value: record.data['biaya'], decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }, { xtype: 'numericfield', fieldLabel: 'Total Bayar DPK', id:'id-bayar', readOnly: true, disabled: false, value: record.data['jmlbayar'], decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.', }] }] }] /* items: [{ id: 'npm', fieldLabel: 'NPM', value:record.data['nim'] }, { id: 'nmmhs', fieldLabel: 'Nama Mahasiswa', value:record.data['nmmhs'], width: 270, }, { id: 'prodi', fieldLabel: 'Program Studi', width: 270, value: RH.getCompValue('tf.prodi-dpkdet') }, { id: 'thnmasuk', fieldLabel: 'Tahun Masuk', value: RH.getCompValue('tf.thnmsk-dpkdet') }] */ }, { items:[gp_rptDPKperMhs], } ] }); var wDPKperMhs = new Ext.Window({ title: 'Detail History Pembayaran DPK', modal: true, layout: 'fit', width:1200, height:345, items: [fprptDPKperMhs] }).show(); } }