function pRptDPKrektor(){
/** COMMON STORES */
var ds_years = store_tahun();
var ds_prodi = store_prodireg();
var ds_stsmt = store_stsmt_private();
var ds_jkls = store_klsmhsplusall();
/** ==============================*/
var ds_rptDPKper = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'rptkeu_controller/get_DpkPerangkatan',
method: 'POST',
}),
//baseParams: { kdprodi:'' },
totalProperty: 'results',
autoLoad : true,
root: 'data',
fields: [
{ name: 'nim' }
, { name: 'nmmhs' }
, { name: 'smt1' }
, { name: 'smt2' }
, { name: 'smt3' }
, { name: 'smt4' }
, { name: 'smt5' }
, { name: 'jmltotal' }
, { name: 'stlunas' }
, { name: 'biaya' }
, { name: 'sisa' }
, { name: "nmstawalmhs" }
, { name: "nmstaktivitasmhs" }
, { name: "nmklsmhs" }
, { name: "nmthnakademik" }
]
});
var ds_smtskrgbrjln = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'rptkeu_controller/get_smtskrgberjalan',
method: 'POST',
}),
baseParams: { smtskrgbrjln:KDSTSEMESTER },
totalProperty: 'results',
autoLoad : true,
root: 'data',
fields: [
{ name: 'nmthnakademik' }
]
});
ds_smtskrgbrjln.load({
scope : this,
callback: function(records, operation, success) {
ds_smtskrgbrjln.each(function (rec) {
smtskrgbrjln = rec.data['nmthnakademik'];
});
Ext.getCmp('tf.thnakasmtskrg-dpk').setValue(smtskrgbrjln);
}
});
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_rptDPKper = new Ext.grid.ColumnModel({
columns: [
new Ext.grid.RowNumberer({width: 30}),
{
header: 'NPM', width: 100,
dataIndex: 'nim', sortable: true
}, {
header: 'Nama Mahasiswa', width: 150,
dataIndex: 'nmmhs', sortable: true
}, {
header: 'Th.Masuk', width: 110,
dataIndex: 'nmthnakademik', sortable: true
},{
header: 'St.Masuk', width: 65,
dataIndex: 'nmstawalmhs', sortable: true
}, {
header: 'Kelas', width: 80,
dataIndex: 'nmklsmhs', sortable: true
},{
header: 'St.Mahasiswa', width: 80,
dataIndex: 'nmstaktivitasmhs', sortable: true
}, {
//header: 'Biaya Tagihan', width: 90,
header: 'Biaya Tagihan', width: 90,
dataIndex: 'biaya', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right',
}, {
header: '', width: 110,
dataIndex: 'smt1', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '', width: 110,
dataIndex: 'smt2', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '', width: 110,
dataIndex: 'smt3', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '', width: 110,
dataIndex: 'smt4', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '', width: 110,
dataIndex: 'smt5', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
//header: 'Bayar', width: 90,
header: 'Bayar', width: 90,
dataIndex: 'jmltotal', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
//header: 'Tunggakan', width: 90,
header: 'Tunggakan', width: 90,
dataIndex: 'sisa', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: 'St.Bayar', width: 80,
dataIndex: 'stlunas', sortable: true,
}]
});
var gp_rptDPKper = new Ext.grid.GridPanel({
id: 'gp.dpk-rpt',
plugins: cari_data_nya,
ds: ds_rptDPKper,
cm: cm_rptDPKper,
sm: new Ext.grid.RowSelectionModel({ singleSelect: true}),
view: new Ext.grid.GridView({ emptyText: '< Belum ada Data >'}),
forceFit: true, //autoHeight: true, width: 720,
tbar: [{hidden:false,
text: 'Print',
iconCls: 'silk-printer',
handler: function(){ fnPrintDpkper(); }
},'-',
{
xtype: 'button',
id: 'btn_excel_dpkrek',
iconCls: 'silk-save',
text: ' Export To Excel',
handler: function() {
exportdpkrek();
}
},'->'],
frame:false,
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-biayatag-dpkdet', 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-dpkdet', 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-sisa-dpkdet', 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: 'textfield', fieldLabel: 'Tot.Lunas',
id:'tf.to-lunas-bayar', readOnly: true, disabled: false, width:50,
style : {
//background : '#6699FF',
fontSize : '13px',
color : 'black',
textAlign: 'right',
}
}]
}, {
xtype: 'form', border: false,
items:[{
xtype: 'textfield', fieldLabel: 'Tot.Blm Lunas',
id:'tf.to-mhs-bayar', readOnly: true, disabled: false, width:50,
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:50,
style : {
//background : '#6699FF',
fontSize : '13px',
color : 'black',
textAlign: 'right',
}
}]
}],
});
//THE FORM PANEL//
var fpRptDPKper = new Ext.Panel({
autoWidth: true,
title: 'Laporan Keuangan DPK Per Angkatan',
id: 'fp.RptDPK',
layout: 'form',
forceFit: true,
autoScroll: true,
margin: '0 0 10',
frame: true,
defaults: { labelWidth: 200, labelAlign: 'right'},
items: [
{
xtype: 'fieldset', flex: 1, region:'north', layout:'column', autoHeight:true,
items: [
{
columnWidth:.3,
layout: 'form',
items: [
{
xtype:'compositefield', id:'cmpopt',
items:[{
xtype: 'combo',
id: 'cb.thmasuk-dpk', fieldLabel: 'Th.Msk/Angkatan',
store: ds_years, triggerAction: 'all', width: 100,
valueField: 'tahun', displayField: 'tahun',
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 tambah1 = angkatan + 1; //menjumlahkan bilangan int
var tambah2 = angkatan + 2; //menjumlahkan bilangan int
//---masukkan ke header kolom 8---//
var plus1 = RH.getCompValue('cb.thmasuk-dpk') + 1;
var thnsmster1 = RH.getRecordFieldValue(ds_stsmt, 'nmthnakademik', 'kdstsemester', plus1);
var thnsmster2 = RH.getRecordFieldValue(ds_stsmt, 'nmjnssemester', 'kdstsemester', plus1);
gp_rptDPKper.getColumnModel().setColumnHeader(8,thnsmster1 + ' ' + thnsmster2);
//--------------------------------//
//---masukkan ke header kolom 9---//
var plus2 = RH.getCompValue('cb.thmasuk-dpk') + 2;
var thnsmster3 = RH.getRecordFieldValue(ds_stsmt, 'nmthnakademik', 'kdstsemester', plus2);
var thnsmster4 = RH.getRecordFieldValue(ds_stsmt, 'nmjnssemester', 'kdstsemester', plus2);
gp_rptDPKper.getColumnModel().setColumnHeader(9,thnsmster3 + ' ' + thnsmster4);
//--------------------------------//
//---masukkan ke header kolom 10---//
var plus3 = String(tambah1) + 1; //merubah ke string
var thnsmster5 = RH.getRecordFieldValue(ds_stsmt, 'nmthnakademik', 'kdstsemester', plus3);
var thnsmster6 = RH.getRecordFieldValue(ds_stsmt, 'nmjnssemester', 'kdstsemester', plus3);
gp_rptDPKper.getColumnModel().setColumnHeader(10,thnsmster5 + ' ' + thnsmster6);
//--------------------------------//
//---masukkan ke header kolom 11---//
var plus4 = String(tambah1) + 2; //merubah ke string
var thnsmster7 = RH.getRecordFieldValue(ds_stsmt, 'nmthnakademik', 'kdstsemester', plus4);
var thnsmster8 = RH.getRecordFieldValue(ds_stsmt, 'nmjnssemester', 'kdstsemester', plus4);
gp_rptDPKper.getColumnModel().setColumnHeader(11,thnsmster7 + ' ' + thnsmster8);
//--------------------------------//
//---masukkan ke header kolom 12---//
var plus5 = String(tambah2) + 1; //merubah ke string
var thnsmster9 = RH.getRecordFieldValue(ds_stsmt, 'nmthnakademik', 'kdstsemester', plus5);
var thnsmster10 = RH.getRecordFieldValue(ds_stsmt, 'nmjnssemester', 'kdstsemester', plus5);
gp_rptDPKper.getColumnModel().setColumnHeader(12,thnsmster9 + ' ' + thnsmster10);
//--------------------------------//
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);
setGridDPKper();
smtskrg();
jmlthp();
jmlmhs();
}
}
},{
xtype: 'textfield', disabled:false, readOnly:true,
id: 'tf.thnaka-dpk', width: 85, //fieldLabel: 'Th.Akademik-Smt',
}]
}, {
xtype: 'combo',
id: 'cb.prodi-dpk', fieldLabel: 'Program Studi',
store: ds_prodi, valueField: 'kdprodi', displayField: 'lnmprodi',
triggerAction: 'all',editable: false, width: 220,
forceSelection: true, submitValue: true, mode: 'local',
emptyText:'Pilih...', //selectOnFocus:true,
listeners:{
scope: this, 'select': function(){ setGridDPKper(); jmlmhs(); }
}
}, {
xtype: 'combo', width: 170,
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(){ setGridDPKper();}
}
}
]
},{
columnWidth:.3,
layout: 'form',
items: [{
xtype: 'textfield', disabled:false, readOnly:true, width: 150,
id: 'tf.thnakasmtskrg-dpk', fieldLabel: 'Th.Aka-Smt Skrg',
}, {
xtype: 'textfield', disabled:false, readOnly:true, width: 50,
id: 'tf.smts-skrg', fieldLabel: 'Semester',
}, {
xtype: 'textfield', width:50, disabled:false, readOnly:true,
id: 'tf.jml-mhs-dpk', fieldLabel: 'Jml.Mahasiswa',
}]
},{
columnWidth:.3,
layout: 'form',
items: [{
xtype: 'textfield', disabled:false, readOnly:true, width: 50,
id: 'tf.jml-thp', fieldLabel: 'Jml.Tahapan',
}, {
xtype: 'numericfield', fieldLabel: 'Jml.Biaya Thpn',
id:'tf.jml-biaya-perthp', readOnly: true, disabled: false, width:150,
decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
}]
}
]
},
{
region: 'center', layout:'form', autoScroll:true,
items:[{
xtype: 'panel', layout:'fit', height:435, //width: 1300,
title:'Laporan Per Mahasiswa', id:'fp.dpk-permahasiswa', frame:true,
items: [gp_rptDPKper]
}]
}, RH.vSpacer(10),
]
}); get_content(fpRptDPKper);
function setGridDPKper(){
if(RH.isEmpty('cb.thmasuk-dpk')) return;
if(RH.isEmpty('cb.prodi-dpk')) return;
if(RH.isEmpty('cb.jkelas-dpk')) return;
RH.setCompValue('tf.to-mhs-bayar', 0);
RH.setCompValue('nf.to-bayar-dpkdet', 0);
RH.setCompValue('nf.to-sisa-dpkdet', 0);
var thmasuk = RH.getCompValue('cb.thmasuk-dpk');
var kdprodi = RH.getCompValue('cb.prodi-dpk');
var idklsmhs = RH.getCompValue('cb.jkelas-dpk');
//Ext.Msg.alert("DEBUG", thmasuk + '-' + idklsmhs);return;
ds_rptDPKper.reload({
params: {
thmasuk: thmasuk,
kdprodi: kdprodi,
idklsmhs: idklsmhs,
},
callback: function(results){
var count = 0;
var count2 = 0;
var count3 = 0;
ds_rptDPKper.each(function (rec) {
if (rec.data['stlunas'] == 'Lunas') {
count = count + 1;
}
if (rec.data['stlunas'] == 'Belum Lunas') {
count2 = count2 + 1;
}
if (rec.data['jmltotal'] > 0) {
count3 = count3 + 1;
}
});
RH.setCompValue('tf.to-lunas-bayar', count);
RH.setCompValue('tf.to-mhs-bayar', count2);
RH.setCompValue('tf.to-totmhs-bayar', count3);
RH.setCompValue('nf.to-biayatag-dpkdet', RH.sumRecVal(ds_rptDPKper, 'biaya'));
RH.setCompValue('nf.to-bayar-dpkdet', RH.sumRecVal(ds_rptDPKper, 'jmltotal'));
RH.setCompValue('nf.to-sisa-dpkdet', RH.sumRecVal(ds_rptDPKper, 'sisa'));
}
});
}
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 jmlmhs(){
var thnmsk = Ext.getCmp('cb.thmasuk-dpk').getValue();
var kdprodi = Ext.getCmp('cb.prodi-dpk').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 fnPrintDpkper(){
var thnmasuk = RH.getCompValue('cb.thmasuk-dpk');
var kdprodi = RH.getCompValue('cb.prodi-dpk');
var idklsmhs = RH.getCompValue('cb.jkelas-dpk');
if(thnmasuk && kdprodi && idklsmhs)
{
RH.ShowReport(BASE_URL + 'print/rpt_det_dpk_perangkatan/get_dpk_perangkatan/'+thnmasuk+'/'+kdprodi+'/'+idklsmhs);
} else
{}
}
//excel
function exportdpkrek(){
var tablename = 'excel_dpk_perangkatan';
var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info');
var thmasuk = RH.getCompValue('cb.thmasuk-dpk');
var kdprodi = RH.getCompValue('cb.prodi-dpk');
var idklsmhs = RH.getCompValue('cb.jkelas-dpk');
if(thmasuk && kdprodi && idklsmhs){
Ext.Ajax.request({
url: BASE_URL + 'rptkeu_controller/get_DpkPerangkatanExcel',
params: {
thmasuk: thmasuk,
kdprodi: kdprodi,
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 Prodi atau Jenis Kelas kosong");
}
}
}