function pRptDPP(){
/**
========= COMMON STORES ==========================
*/
var ds_stsmt = store_thnakademik2();
var ds_jkls = store_klsmhsplusall();
var ds_years = store_tahun();
var ds_persen = new Ext.data.JsonStore({ //from database
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'data_controller/get_set_tahapanbyr_dpp ',
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' }
]
});
var ds_rptDPP = new Ext.data.GroupingStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'rptkeu_controller/get_DppAllProdi',
method: 'POST',
}),
reader: reader,
groupField:'fakultas',
//sortInfo:{field:'kdfakultas',direction:'ASC'},
remoteSort: true,
});
var cm_rptDPP = new Ext.grid.ColumnModel({
columns: [{
header: 'Fakultas/Program Studi', width: 300,
dataIndex: 'fakultas', //sortable: true
}, {
header: 'Fakultas/Program Studi', width: 300,
dataIndex: 'lnmprodi', //sortable: true
}, {
header: 'Biaya Tagihan', width: 150,
dataIndex: 'biaya',
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: 'Bayar', width: 150,
dataIndex: 'jmlbayar',
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '% Bayar', width: 100,
dataIndex: 'persenbayar',
xtype: 'numbercolumn', format:'0.%',
align:'right',
/* renderer: function(value, p, r)
{return r.data['persenbayar'] + ' %'} */
}, {
header: 'Tunggakan', width: 150,
dataIndex: 'sisa',
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '% Tunggakan', width: 100,
dataIndex: 'persensisa',
xtype: 'numbercolumn', format:'0.%',
align:'right',
/* renderer: function(value, p, r)
{return r.data['persensisa'] + ' %'} */
}, {
header: 'Diskon', width: 150,
dataIndex: 'diskon',
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_rptDPP = new Ext.grid.GridPanel({
id: 'gp.dpk-rpt',
//title: 'Laporan Keuangan DPP',
plugins: cari_data_nya1,
ds: ds_rptDPP,
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: 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(){ fnPrintDpp(); }
}, '-',{
text: 'Print Per Persentase',
iconCls: 'silk-printer',
handler: function(){ fnPrintDppPers(); }
},'-',
{
xtype: 'button',
id: 'btn_excel_dppall',
iconCls: 'silk-save',
text: ' Export To Excel',
handler: function() {
exportdppallprodi();
}
},'->'],
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-dpp', 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-dpp', 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-dpp', 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-dpp', 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: onRowDppClick
}
});
var ds_rptDPPdet = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'rptkeu_controller/get_DppDet',
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: "stmahasiswa" }
, { name: "stawlmhs" }
, { name: "thnmasuk" }
, { name: "nmklsmhs" }
]
});
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_rptDPPdet = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer({width: 45}),
{
header: 'NPM', width: 100,
dataIndex: 'nim', sortable: true
}, {
header: 'Nama Mahasiswa', width: 200,
dataIndex: 'nmmhs', sortable: true
}, {
header: 'Th.Masuk', width: 70,
dataIndex: 'thnmasuk', sortable: true
}, {
header: 'St.Masuk', width: 70,
dataIndex: 'stawlmhs', sortable: true
}, {
header: 'St.Mahasiswa', width: 90,
dataIndex: 'stmahasiswa', sortable: true
}, {
header: 'Kelas', width: 70,
dataIndex: 'nmklsmhs', sortable: true
}, {
header: 'Biaya Tagihan', width: 90,
dataIndex: 'biaya', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: 'Bayar', width: 90,
dataIndex: 'jmlbayar', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '% Bayar', width: 90,
dataIndex: 'persenbayar', sortable: true,
xtype: 'numbercolumn', format:'0.%',
align:'right',
/* renderer: function(value, p, r)
{return r.data['persenbayar'] + ' %'} */
}, {
header: 'Tunggakan', width: 90,
dataIndex: 'sisa', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}, {
header: '% Tunggakan', width: 90,
dataIndex: 'persensisa', sortable: true,
xtype: 'numbercolumn', format:'0.%',
align:'right',
/* renderer: function(value, p, r)
{return r.data['persensisa'] + ' %'} */
}, {
header: 'St.Bayar', width: 80,
dataIndex: 'stlunas', sortable: true,
},{
header: 'Diskon', width: 90,
dataIndex: 'diskon', sortable: true,
xtype: 'numbercolumn', format:'0,000', align:'right'
}]
);
var gp_rptDPPdet = new Ext.grid.GridPanel({
id: 'gp.dpkdet-rpt',
plugins: cari_data_nya,
//title: 'Laporan per Mahasiswa',
ds: ds_rptDPPdet,
cm: cm_rptDPPdet,
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;
}
}
fnPrintDetailDpp();
}
},'-',
{
xtype: 'button',
id: 'btn_excel_dppdet',
iconCls: 'silk-save',
text: ' Export To Excel',
handler: function() {
exportdppdet();
}
},{
xtype: 'button',
id: 'btn_excel_cms_dppdet',
iconCls: 'silk-save',
text: ' Export As CMS',
handler: function() {
eksportascmsdppdet();
}
},'-','->',
{
xtype: 'button',
id: 'btn_excel_cms_dppdet_angkatan',
iconCls: 'silk-save',
text: ' Export As CMS By Angkatan',
handler: function() {
eksportascmsdppdetangkatan();
}
},{
xtype: 'button',
id: 'btn_excel_dppdet_angkatan',
iconCls: 'silk-save',
text: ' Export To Excel By Angkatan',
handler: function() {
exportdppdetangkatan();
}
},{
xtype: 'combo',
id: 'cb.thmasuk-dpp', width: 145,
store: ds_years, triggerAction: 'all',
valueField: 'tahun', displayField: 'tahun',
forceSelection: true, submitValue: true, mode: 'local',
emptyText:'Pilih Tahun Angkatan...',
}],
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-dppdet', 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-dppdet', 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-sisa-dppdet', 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-dppdet', 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-lns-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-mhs-bayar', readOnly: true, disabled: false, width:35,
style : {
//background : '#6699FF',
fontSize : '13px',
color : 'black',
textAlign: 'right',
}
}]
}],
listeners: {
rowclick: showRptDPPperMhs
}
});
//THE FORM PANEL
var fpRptDPP = new Ext.Panel({
id: 'fp.RptDPP',
title:'Laporan Keuangan DPP',
layout: 'form',
forceFit: true,
maskDisabled: false,
monitorValid: true,
autoScroll: true,
//width:500, height:400,
margin: '0 0 10',
frame: true,
xtype: 'form',
defaults: { labelWidth: 170, labelAlign: 'right'},
items: [
{
xtype: 'fieldset', flex: 1, region:'north', layout:'column', autoHeight:true,
items: [
{
columnWidth:.4,
layout: 'form',
items: [{
xtype: 'combo', fieldLabel: 'Th.Akademik-Smt',
id: 'cb.stsmt-dpp', store: ds_stsmt, width: 170,
valueField: 'kdstsemester', displayField: 'nmthnakademik',//'nmsmt',
editable: false, triggerAction: 'all',
forceSelection: true, submitValue: true, mode: 'local',
emptyText:'Pilih...',
listeners:{
scope: this, 'select': function(){ smtdpp_selected();}
}
}]
},
{
columnWidth:.4,
layout: 'form',
items: [{
xtype: 'combo', width: 170,
id: 'cb.jkelas-dpp', 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(){ setGridDPP(); }//setGridDPPdet();}
}
}]
}
]
},
{
region: 'center', layout:'form', autoScroll:true,
items:[{
xtype: 'panel', layout:'fit', height:350, //width: 1300,
title:'Laporan Per Fakultas/Program Studi', id:'fp.dpp-fakultas', frame:true,
items: [gp_rptDPP]
}]
}, RH.vSpacer(10),
{
items: [{
xtype: 'fieldset', flex: 1, region:'north', layout:'column', autoHeight:true,
items: [
{
columnWidth:.4,
layout: 'form',
items: [
{
xtype: 'combo', width: 150, emptyText:'Pilih...',
id: 'cb.persen-dppdet', 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(){ }//setGridDPPdet();}
}
},{
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');
setGridDPPdet(cmbopt1,txtopt1,cmbopt2,txtopt2);
}
}]
},{
xtype: 'textfield', width:50, disabled:false, readOnly:true,
id: 'tf.jml-mhs-dpp', fieldLabel: 'Jml.Mahasiswa',
}
]
},
{
columnWidth:.4,
layout: 'form',
items: [
{
xtype: 'textfield', disabled:false, readOnly:true,
id: 'tf.thnakasmt-dppdet', fieldLabel: 'Th.Akademik-Smt',
}, {
xtype: 'textfield', width:325, disabled:false, readOnly:true,
id: 'tf.prodi-dppdet', fieldLabel: 'Program Studi',
}
]
},
{
xtype: 'hidden', id: 'hf.kdprodi-dppdet', //FOR STORING kdprodi
}
]
}]
},
{
region: 'center', layout:'form', autoScroll:true,
items:[{
xtype: 'panel', layout:'fit', height:350,
title:'Laporan Per Mahasiswa', id:'fp.dpp-mahasiswa', frame:true,
items: [gp_rptDPPdet]
}],
}
]
}); get_content(fpRptDPP);
/*
var wRptDpp = new Ext.Window({
title: 'Laporan Keuangan DPP',
modal: false,
layout: 'fit',
minimizable:true,
width:1000, height:570,
items: [fpRptDPP],
bbar: [{xtype:'tbfill'},
{ text: 'Close', iconCls: 'silk-cancel', handler: function(){ wRptDpp.close();} }]
}).show();
*/
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
}
//excel
function exportdppallprodi(){
var tablename = 'excel_dpp_all_prodi';
var waitmsgexport = Ext.MessageBox.wait('Exporting Data...', 'Info');
var thakademik = Ext.getCmp('cb.stsmt-dpp').getValue();
var idklsmhs = Ext.getCmp('cb.jkelas-dpp').getValue();
if(thakademik && idklsmhs){
Ext.Ajax.request({
url: BASE_URL + 'rptkeu_controller/get_DppAllProdiExcel',
params: {
kdstsemester: RH.getCompValue('cb.stsmt-dpp'),
idklsmhs: RH.getCompValue('cb.jkelas-dpp'),
},
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.Akademik-Smt atau Jenis Kelas kosong");
}
}
function exportdppdet(){
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_dpp_det';
var thakademik = Ext.getCmp('cb.stsmt-dpp').getValue();
var idklsmhs = Ext.getCmp('cb.jkelas-dpp').getValue();
var prodi = (RH.getCompValue('hf.kdprodi-dppdet')) ? RH.getCompValue('hf.kdprodi-dppdet'):'-';
var isAllProdi = "";
if (!thakademik) {
Ext.MessageBox.alert("Info", "Pilih Thn.Akademik-Smt"); 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_DppDetExcel',
params: {
kdstsemester: RH.getCompValue('cb.stsmt-dpp'),
idklsmhs: RH.getCompValue('cb.jkelas-dpp'),
kdprodi: prodi,
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 exportdppdetangkatan(){
var kdprodi = (RH.getCompValue('hf.kdprodi-dppdet')) ? RH.getCompValue('hf.kdprodi-dppdet'):'-';
var kdstsemester = RH.getCompValue('cb.stsmt-dpp');
var thnmasuk = RH.getCompValue('cb.thmasuk-dpp');
var klsmhs = RH.getCompValue('cb.jkelas-dpp');
var persen1 = Ext.getCmp('tf.persen1').getValue();
var kondisi1 = Ext.getCmp('cb.operator1-dpkdet').getValue();
var persen2 = (Ext.getCmp('tf.persen2').getValue()) ? Ext.getCmp('tf.persen2').getValue():'-';
var kondisi2 = Ext.getCmp('cb.operator2-dpkdet').getValue();
var isAllProdi = "";
//encrip kondisi1
if(kondisi1 == '='){
kondisi1 = 1;
}else if(kondisi1 == '<>'){
kondisi1 = 2;
}else if(kondisi1 == '>'){
kondisi1 = 3;
}else if(kondisi1 == '>='){
kondisi1 = 4;
}else if(kondisi1 == '<'){
kondisi1 = 5;
}else if(kondisi1 == '<='){
kondisi1 = 6;
}else{
kondisi1 = '-';
}
//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;
}else{
kondisi2 = '-';
}
if (!kdstsemester) {
Ext.MessageBox.alert("Info", "Pilih Thn.Akademik-Smt"); return;
} else if (!klsmhs){
Ext.MessageBox.alert("Info", "Pilih Jenis Kelas"); return;
} else if (!thnmasuk){
Ext.MessageBox.alert("Info", "Pilih Tahun Angkatan"); return;
} else if (!kondisi1 || !isNumeric(persen1)){
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 (kdprodi=='-'){
Ext.MessageBox.alert("Info", "Pilih Program Studi"); return;
} else {
isAllProdi = "0";
}
}
if (isAllProdi) {
window.location = BASE_URL + 'rptkeu_controller/exportexceldppangkatan/'+kdprodi+'/'+kdstsemester+'/'+
thnmasuk+'/'+klsmhs+'/'+persen1+'/'+kondisi1+'/'+persen2+'/'+kondisi2+'/'+isAllProdi;
}
}
});
}
}
function eksportascmsdppdet() {
var kdprodi = (RH.getCompValue('hf.kdprodi-dppdet')) ? RH.getCompValue('hf.kdprodi-dppdet'):'-';
var nmprodi = RH.getCompValue('tf.prodi-dppdet');
var kdstsemester = RH.getCompValue('cb.stsmt-dpp');
var klsmhs = RH.getCompValue('cb.jkelas-dpp');
var isAllProdi = "";
if (!kdstsemester) {
Ext.MessageBox.alert("Info", "Pilih Thn.Akademik-Smt"); 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/exportascmsdpp/'+kdprodi+'/'+kdstsemester+'/'+
klsmhs+'/'+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 eksportascmsdppdetangkatan() {
var kdprodi = (RH.getCompValue('hf.kdprodi-dppdet')) ? RH.getCompValue('hf.kdprodi-dppdet'):'-';
var nmprodi = RH.getCompValue('tf.prodi-dppdet');
var kdstsemester = RH.getCompValue('cb.stsmt-dpp');
var thnmasuk = RH.getCompValue('cb.thmasuk-dpp');
var klsmhs = RH.getCompValue('cb.jkelas-dpp');
var isAllProdi = "";
if (!kdstsemester) {
Ext.MessageBox.alert("Info", "Pilih Thn.Akademik-Smt"); return;
} else if (!klsmhs){
Ext.MessageBox.alert("Info", "Pilih Jenis Kelas"); return;
} else if (!thnmasuk){
Ext.MessageBox.alert("Info", "Pilih Tahun Angkatan"); 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: 170,
width: 500,
layout: 'form',
items: [{
xtype: 'textfield',
fieldLabel: 'Program Studi',
id: 'prodiselect',
width: 350, disabled:true
},{
xtype: 'textfield',
fieldLabel: 'Tahun Angkatan',
id: 'thangkatan', value:thnmasuk,
width: 150, 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 By Angkatan',
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/exportascmsdppangkatan/'+kdprodi+'/'+kdstsemester+'/'+
thnmasuk+'/'+klsmhs+'/'+isAllProdi+'/'+nobriva+'/'+kodebiaya;
}
},
{
text: 'Kembali',
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 fnPrintDpp(){
var semester = RH.getCompValue('cb.stsmt-dpp');
var jenis_kelas = RH.getCompValue('cb.jkelas-dpp');
var semestershow = Ext.getCmp('cb.stsmt-dpp').getRawValue().replace('/','_');
if(semester && jenis_kelas){
RH.ShowReport(BASE_URL + 'print/rpt_dpp/get_dpp/'+semester+'/'+jenis_kelas+'/'+semestershow);
} else
{}
}
function fnPrintDppPers(){
var semester = RH.getCompValue('cb.stsmt-dpp');
var jenis_kelas = RH.getCompValue('cb.jkelas-dpp');
var semestershow = Ext.getCmp('cb.stsmt-dpp').getRawValue().replace('/','_');
if(semester && jenis_kelas){
RH.ShowReport(BASE_URL + 'print/rpt_dpp_perpersentase/get_dpp_perpersentase/'+semester+'/'+jenis_kelas+'/'+semestershow);
} else
{}
}
function fnPrintDetailDpp(){
var addslash1 = '';
var addslash = Ext.getCmp('cb.persen-dppdet').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 + 'print/rpt_det_dpp/get_det_dpp/'+semester+'/'+jns_kelas+'/'+kdprodi+'/'+persen1+'/'+kondisi1+'/'+persen2+'/'+kondisi2+'/'+opt);
} else
{}
}
function smtdpp_selected(){
setGridDPP();
//setGridDPPdet();
}
function setGridDPP(){
if(RH.isEmpty('cb.stsmt-dpp')) return;
if(RH.isEmpty('cb.jkelas-dpp')) return;
//debug//RH.warning(RH.getCompValue('cb.stsmt-dpp'));return;
ds_rptDPP.reload({
params: {
kdstsemester: RH.getCompValue('cb.stsmt-dpp'),
idklsmhs: RH.getCompValue('cb.jkelas-dpp'),
},
callback: function(results){
RH.setCompValue('nf.to-biaya-dpp', RH.sumRecVal(ds_rptDPP, 'biaya'));
RH.setCompValue('nf.to-bayar-dpp', RH.sumRecVal(ds_rptDPP, 'jmlbayar'));
RH.setCompValue('nf.to-tunggakan-dpp', RH.sumRecVal(ds_rptDPP, 'sisa'));
RH.setCompValue('nf.to-diskon-dpp', RH.sumRecVal(ds_rptDPP, 'diskon'));
}
});
}
function onRowDppClick(grid, rowIdx){
var thnakasmt = Ext.getCmp('cb.stsmt-dpp').getRawValue();
var record = ds_rptDPP.getAt(rowIdx);
RH.setCompValue('tf.prodi-dppdet',record.data['lnmprodi']);
RH.setCompValue('hf.kdprodi-dppdet',record.data['kdprodi']);
RH.setCompValue('tf.thnakasmt-dppdet', thnakasmt);
jmlmhs();
setGridDPPdet('>=',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 thakademik = Ext.getCmp('cb.stsmt-dpp').getValue();
var kdprodi = Ext.getCmp('hf.kdprodi-dppdet').getValue();
Ext.Ajax.request({
url: BASE_URL + 'rptkeu_controller/get_jmlmhsdpp',
method: 'POST',
params :{
thakademik: thakademik,
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-dpp', data.jummhsdpp);
}
});
}
function setGridDPPdet(cmbopt1,txtopt1,cmbopt2,txtopt2){
if(RH.isEmpty('cb.stsmt-dpp')) return;
if(RH.isEmpty('cb.jkelas-dpp')) return;
if(RH.isEmpty('hf.kdprodi-dppdet')) return;
//the key
var kdprodi = RH.getCompValue('hf.kdprodi-dppdet');
//initialize
RH.setCompValue('tf.to-mhs-bayar', 0);
RH.setCompValue('nf.to-biaya-dppdet', 0);
RH.setCompValue('nf.to-bayar-dppdet', 0);
RH.setCompValue('nf.to-sisa-dppdet', 0);
RH.setCompValue('nf.to-diskon-dppdet', 0);
var addslash1 = '';
var addslash = Ext.getCmp('cb.persen-dppdet').getRawValue();
for (i=0;i 0) {
count2 = count2 + 1;
}
});
RH.setCompValue('tf.to-lns-bayar', count);
RH.setCompValue('tf.to-blm-bayar', count1);
RH.setCompValue('tf.to-mhs-bayar', count2);
RH.setCompValue('nf.to-biaya-dppdet', RH.sumRecVal(ds_rptDPPdet, 'biaya'));
RH.setCompValue('nf.to-bayar-dppdet', RH.sumRecVal(ds_rptDPPdet, 'jmlbayar'));
RH.setCompValue('nf.to-sisa-dppdet', RH.sumRecVal(ds_rptDPPdet, 'sisa'));
RH.setCompValue('nf.to-diskon-dppdet', RH.sumRecVal(ds_rptDPPdet, 'diskon'));
}
});
}
function showRptDPPperMhs(grid, rowIdx){
var record = ds_rptDPPdet.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_rptDPPperMhs = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: BASE_URL + 'rptkeu_controller/get_DppPerMhs',
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_rptDPPperMhs = 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_rptDPPperMhs = new Ext.grid.GridPanel({
id: 'gp.dpk-rpt-mhs',
ds: ds_rptDPPperMhs,
cm: cm_rptDPPperMhs,
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 fprptDPPperMhs = 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-dppdet'), 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: record.data['thnmasuk'], xtype: 'textfield', disabled:false, readOnly:true,
}, {
id: '', fieldLabel: 'Status Masuk', width: 100, value:record.data['stawlmhs'], xtype: 'textfield', disabled:false, readOnly:true,
}, {
id: '', fieldLabel: 'Status Mahasiswa', width: 200, value:record.data['stmahasiswa'], xtype: 'textfield', disabled:false, readOnly:true,
}]
},{
columnWidth:.3,
layout: 'form',
items: [{
xtype: 'numericfield', fieldLabel: 'Diskon DPP',
id:'iddiskon', readOnly: true, disabled: false, value: record.data['diskon'],
decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
}, {
xtype: 'numericfield', fieldLabel: 'Tagihan DPP',
id:'id-biaya', readOnly: true, disabled: false, value: record.data['biaya'],
decimalSeparator: ',', decimalPrecision: 0, alwaysDisplayDecimals: true,
useThousandSeparator: true, thousandSeparator: '.',
}, {
xtype: 'numericfield', fieldLabel: 'Total Bayar DPP',
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_rptDPPperMhs],
}
]
});
var wDPKperMhs = new Ext.Window({
title: 'Detail History Pembayaran DPP',
modal: true,
layout: 'fit',
width:1200, height:345,
items: [fprptDPPperMhs]
}).show();
}
}