function pRptDPPDKP(){ /** ========= COMMON STORES ========================== */ var reader = new Ext.data.JsonReader({ root:'data', idProperty: '', totalProperty: 'results', remoteGroup: true, fields: [ { name: 'nokuitansi' } , { name: 'tglkuitansi' } , { name: 'nim' } , { name: 'nmmhs' } , { name: 'kdprodi' } , { name: 'nmprodi' } , { name: 'kdfakultas' } , { name: 'nmfakultas' } , { name: 'kdjnsbiaya' } , { name: 'nmcarabyr' } , { name: 'jmlbayar' } , { name: 'catatan' } , { name: 'useridinput' } ] }); var ds_rptDPPDPK = new Ext.data.GroupingStore({ proxy: new Ext.data.HttpProxy({ url: BASE_URL + 'rptkeu_controller/get_DppDpk', method: 'POST', }), reader: reader, groupField:'nmfakultas', //sortInfo:{field:'kdfakultas',direction:'ASC'}, remoteSort: true, }); var cm_rptDPP = new Ext.grid.ColumnModel({ columns: [{ header: 'Fakultas', width: 200, dataIndex: 'nmfakultas', hidden:true },{ header: 'Fakultas/Program Studi', width: 280, dataIndex: 'nmprodi', hidden:false }, { header: 'No. Kuitansi', width: 140, dataIndex: 'nokuitansi' }, { header: 'Tgl. Kuitansi', width: 125, dataIndex: 'tglkuitansi' }, { header: 'NPM', width: 150, dataIndex: 'nim' }, { header: 'Nama Mahasiswa', width: 200, dataIndex: 'nmmhs' }, { header: 'Jenis Biaya', width: 100, dataIndex: 'kdjnsbiaya' }, { header: 'Cara Bayar', width: 100, dataIndex: 'nmcarabyr' }, { header: 'Nominal', width: 100, dataIndex: 'jmlbayar', xtype: 'numbercolumn', format:'0,000', align:'right' }, { header: 'Keterangan', width: 150, dataIndex: 'catatan' }, { header: 'User Input', width: 100, dataIndex: 'useridinput' }] }); var gp_rptDPPDPK = new Ext.grid.GridPanel({ id: 'gp.dppdpk-rpt', //title: 'Laporan Keuangan DPP', ds: ds_rptDPPDPK, cm: cm_rptDPP, 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: false, // 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 }), forceFit: true, autoHeight: true, //250, //width: 720, tbar: [{hidden:false, text: 'Print', iconCls: 'silk-printer', handler: function(){ var interval =DateDiff(Ext.getCmp('tglawal').getValue(), Ext.getCmp('tglakhir').getValue()); if (interval < 0) { Ext.MessageBox.alert('Informasi', 'Format Tanggal Tidak Valid'); return false } fnPrintDppDpk(); } },'->'], autoScroll: true, autoSizeColumns: true, autoExpandColumn: 'nmfakultas', enableColumnResize: true, enableColumnHide: false, enableColumnMove: false, enableHdaccess: false, columnLines: true, loadMask: true, layout: 'anchor' }); //THE FORM PANEL var fpRptDPPDPK = new Ext.form.FormPanel({ id: 'fp.RptDPPDPK', //title:'Laporan Keuangan DPP', layout: 'form', forceFit: true, autoScroll: true, //width:500, height:400, margin: '0 0 10', frame: true, items: [{ xtype: 'fieldset', title: 'Laporan Penerimaan DPP/DPK', //flex: 1, items: [{ //////////////////// layout: 'column', items: [{ layout: 'form', columnWidth: 0.30, defaults: { labelWidth: 50, labelAlign: 'left'}, items: [{ xtype: 'datefield', fieldLabel: 'Periode', name: 'tglawal', id: 'tglawal', value: new Date().format('d/m/Y'), format: "d/m/Y", width: 150, listeners: {} }] }, { xtype: 'label', text: ' s/d ', id: 'sd', width: 30 }, { xtype: 'datefield', fieldLabel: '', name: 'tglakhir', id: 'tglakhir', value: new Date().format('d/m/Y'), format: "d/m/Y", width: 150, listeners: {} }, { xtype: 'button', text: ' Cari ', iconCls: 'silk-find', id: 'btn_data', width: 3, handler: function() { var interval =DateDiff(Ext.getCmp('tglawal').getValue(), Ext.getCmp('tglakhir').getValue()); if (interval < 0) { Ext.MessageBox.alert('Informasi', 'Format Tanggal Tidak Valid'); return false } setGridDPPDPK(); } }] ///////////////////// }, { xtype: 'panel', layout:'fit', items: [gp_rptDPPDPK, { xtype: 'fieldset', title: 'Summary', items: [{ xtype: 'fieldset', title: 'Cara Bayar', width: 300, defaults: { xtype: 'numericfield', decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true, useThousandSeparator: true, thousandSeparator: '.' }, items: [{ fieldLabel: 'Cash/Tunai', id: 'cash', readOnly: true, width: 150 }, { fieldLabel: 'Transfer', id: 'transfer', readOnly: true, width: 150 }, { fieldLabel: 'Via Bank', id: 'viabank', readOnly: true, width: 150 }, { fieldLabel: 'Total', labelStyle: 'font-weight: bold;', style: 'font-weight: bold;text-align: right;', id: 'total', readOnly: true, width: 150 }] }] }], }] }] }); SET_PAGE_CONTENT(fpRptDPPDPK); function fnPrintDppDpk(){ var tgl1 = Ext.getCmp('tglawal').getValue().format('Y-m-d') var tgl2 = Ext.getCmp('tglakhir').getValue().format('Y-m-d') var parsing = ''; parsing = parsing + '1' + 'istra' ; parsing = parsing + '2' + 'istra' ; parsing = parsing + '3' + 'istra' ; parsing = parsing + tgl1 + 'istra' ; parsing = parsing + tgl2 + 'istra' ; var win = window.open(); win.location.reload(); win.location = BASE_URL + 'rpt/rpt_dppdpk/get_dppdpk/'+parsing; } function setGridDPPDPK(){ //debug//RH.warning(RH.getCompValue('cb.stsmt-dpp'));return; ds_rptDPPDPK.reload({ params: { tglawal: Ext.getCmp('tglawal').getValue(), tglakhir: Ext.getCmp('tglakhir').getValue(), } }); Ext.Ajax.request({ url: BASE_URL + 'rptkeu_controller/get_sum_dppdpk', method: 'POST', params:{ carabayar1:'1', carabayar2:'2', carabayar3:'3', tglawal: Ext.getCmp('tglawal').getValue(), tglakhir: Ext.getCmp('tglakhir').getValue() }, success: function(response) { var arrjson = Ext.decode(response.responseText); Ext.getCmp("cash").setValue(arrjson.sum1); Ext.getCmp("transfer").setValue(arrjson.sum2); Ext.getCmp("viabank").setValue(arrjson.sum3); Ext.getCmp("total").setValue(arrjson.sumall); } }); } function DateDiff(date1,date2) { return date2.getTime() - date1.getTime(); } }