This commit is contained in:
Pusdatin BPKD Jkt
2022-07-19 15:29:34 +07:00
parent 7f9982a4c7
commit f23fc3ebbd
9 changed files with 67 additions and 21 deletions
@@ -7,11 +7,11 @@
@extends('layouts.app')
@section('styles')
<!-- DataTables -->
<link rel="stylesheet" href="/AdminLTE-3.2.0/plugins/datatables-bs4/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="/AdminLTE-3.2.0/plugins/datatables-responsive/css/responsive.bootstrap4.min.css">
<link rel="stylesheet" href="/AdminLTE-3.2.0/plugins/datatables-buttons/css/buttons.bootstrap4.min.css">
<link rel="stylesheet" href="/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/css/fixedColumns.bootstrap4.min.css">
<link rel="stylesheet" href="/AdminLTE-3.2.0/plugins/datatables-rowgroup/css/rowGroup.bootstrap4.min.css">
@endsection
@section('card_header')
@@ -47,7 +47,7 @@
</div>
</div>
</div>
<table id="dtTableSKPP" class="table table-striped jambo_table tblClickRow" style="width:150%">
<table id="dtTableJadwalPendapatan" class="table table-striped jambo_table tblClickRow" style="width:150%">
<thead>
<tr class="headings">
<th>No</th>
@@ -85,6 +85,8 @@
<script src="/AdminLTE-3.2.0/plugins/datatables-buttons/js/buttons.colVis.min.js"></script>
<script src="/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/dataTables.fixedColumns.min.js"></script>
<script src="/AdminLTE-3.2.0/plugins/datatables-fixedcolumns/js/fixedColumns.bootstrap4.min.js"></script>
<script src="/AdminLTE-3.2.0/plugins/datatables-rowgroup/js/dataTables.rowGroup.min.js"></script>
<script src="/AdminLTE-3.2.0/plugins/datatables-rowgroup/js/rowGroup.bootstrap4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var srcDate1 = null, srcDate2 = null;
@@ -100,7 +102,7 @@
dtTable.draw();
});
var dtTable = $('#dtTableSKPP').DataTable( {
var dtTable = $('#dtTableJadwalPendapatan').DataTable( {
"processing": true,
"serverSide": true,
"ordering": false,
@@ -119,10 +121,10 @@
"columnDefs": [
//{ className: "td-nowrap", "targets": [ 1 ] }
],
"dom": "<\"top\" <\"row\"<\"col-md-6\"><\"col-md-6 text-right\">>>rt<\"bottom\" <\"row\"<\"col-md-6\"i><\"col-md-6\"p>> ><\"clear\">",
"dom": "<\"top\" <\"row\"<\"col-md-6\"l><\"col-md-6 text-right\">>>rt<\"bottom\" <\"row\"<\"col-md-6\"i><\"col-md-6\"p>> ><\"clear\">",
"lengthMenu": [
[ 10, 25, 50 ],
[ "10", "25", "50" ]
[ 50, 75, 100 ],
[ "50", "75", "100" ]
],
"paging": true, // Table pagination
"columns": [
@@ -152,7 +154,7 @@
let total = 0;
$("td:eq(0)", nRow).html(index);
$("td:eq(1)", nRow).html(aData["kode_rekening"]+" "+aData["nama_rekening"]);
$("td:eq(1)", nRow).html(aData["kode_rekening"]+" | "+aData["nama_rekening"]);
$.each(sps, function(i,x){
$("td:eq("+(i+2)+")", nRow).html(separateNumberIndo(sps[i]));
total+=parseFloat(sps[i]);
@@ -162,7 +164,7 @@
return nRow;
},
"language": {
"lengthMenu": "Display _MENU_ records per page",
"lengthMenu": "Tampilkan _MENU_ Data per Halaman",
"zeroRecords": "Data tidak ditemukan!",
"info": "Halaman _PAGE_ dari _PAGES_ Halaman",
"infoEmpty": "Data tidak tersedia",
@@ -177,6 +179,50 @@
fixedColumns: {
left: 2,
},
rowGroup: {
endRender: function ( rows, group, index ) {
let sum = [];
let total = 0;
for(let x=0;x<12;x++){
xx = x+1;
sum[x] = rows.data().pluck("spsbulan"+xx).reduce( function (a, b) {
return a + b * 1;
}, 0);
total += sum[x];
}
let textmuted = index == 1 ? "text-muted":"";
let labelGroup = index == 1 ?"JUMLAH | " + group : "TOTAL";
return $("<tr/>")
.append( "<td colspan=2 class=\'text-left " + textmuted +"\'><strong>"+labelGroup+"</strong></td>")
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[0]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[1]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[2]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[3]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[4]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[5]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[6]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[7]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[8]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[9]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[10]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[11]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(total) +"</strong></td>" );
},
startRender: function ( rows, group, index ) {
// let group1 = rows.data().pluck("GROUP1");
// let group2 = rows.data().pluck("GROUP2");
// let groupNumber = index == 0 ? group1[0] : group2[0];
// if (index == 0){
// return $("<tr/>")
// .append("<td colspan=5><a href=\'/akun/index/detail/?acc="+groupNumber.split(".").join("_")+"\'>" + groupNumber + ". " + group + "</a></td>")
// }else{
// return $("<tr/>")
// .append("<td colspan=5>&nbsp;&nbsp;<a href=\'/akun/index/detail/?acc="+groupNumber.split(".").join("_")+"\'><strong>" + groupNumber + ". " + group + "</strong></a></td>")
// }
},
dataSrc: ["groupall", "kodegrup"]
},
});
});
</script>