This commit is contained in:
Pusdatin BPKD Jkt
2022-08-09 15:48:49 +07:00
parent 7e9b0e284a
commit e0ac0bb8db
16 changed files with 232 additions and 208 deletions
@@ -15,13 +15,36 @@
@endsection
@section('content')
<div class="card">
<div class="card-header border-0">
<h2 class="card-title"><i class="fa fa-search mr-2"></i> Filter Pencarian</h2>
<div class="card-tools">
<button type="button" class="btn btn-secondary btn-sm" data-card-widget="collapse" title="Collapse">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body pt-0 pb-0">
<div class="form-group col-1">
<label>Tahun Anggaran</label>
<select class="form-control form-control-sm" id="srcTA">
@php
$listTA = Session::get('listTA');
foreach($listTA as $rowTA){
echo "<option>$rowTA</option>";
}
@endphp
</select>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h2 class="card-title"><i class="fa fa-th-list mr-2"></i> Jadwal Salur</h2>
<div class="card-tools">
{{-- @if(auth()->user()->can('Tambah SKPP')) --}}
{{-- <button class="btn btn-sm btn-success" onclick="location.href='{{ route('salur-dana.create') }}'"><i class="fa fa-edit"></i> Tambah Data</button> --}}
{{-- @endif --}}
<button type="button" class="btn btn-secondary btn-sm" data-card-widget="collapse" title="Collapse">
<i class="fas fa-minus"></i>
</button>
</div>
</div>
<div class="card-body">
@@ -87,27 +110,6 @@
</div>
</div>
<div class="card-body">
<div class="row">
<div class="col-1">
<div class="form-group">
<label>Periode</label>
<select class="form-control form-control-sm" id="srcTA">
@php
$listTA = Session::get('listTA');
foreach($listTA as $rowTA){
echo "<option>$rowTA</option>";
}
@endphp
</select>
</div>
</div>
<div class="col-11">
<div class="form-group">
<label>Berdasarkan Kata</label>
<input class="form-control form-control-sm" type="text" id="src">
</div>
</div>
</div>
<table id="dtTableJadwalBelanja" class="table table-bordered table-striped jambo_table tblClickRow" style="width:150%">
<thead>
<tr class="headings">
@@ -308,7 +310,7 @@
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: function (d) {
d.src = $("#src").val(),
//d.src = $("#src").val(),
d.ta = $("#srcTA").val()
}
},
@@ -366,7 +368,7 @@
let totalReal = 0;
let Jadwalcol=3;
$("td:eq(0)", nRow).html(index);
$("td:eq(1)", nRow).html(aData["kode_rsk"] + " | " + aData["nama_rsk"]);
$("td:eq(1)", nRow).html("<div class='text-wrap width-200'>" + aData["kode_rsk"] + " | " + aData["nama_rsk"] + "</div>");
$("td:eq(2)", nRow).html(separateNumberIndo(aData["jumlah_anggaran"]));
$.each(akb, function(i,x){
$("td:eq("+Jadwalcol+")", nRow).html(separateNumberIndo(parseFloat(akb[i])));
@@ -396,63 +398,62 @@
fixedColumns: {
left: 3,
},
rowGroup: {
endRender: function ( rows, group, index ) {
let sum = [];
let sumReal = [];
let total = 0;
let totalReal = 0;
for(let x=0;x<12;x++){
xx = ("00"+(x+1));
xx = xx.substring(xx.length - 2);
sum[x] = rows.data().pluck("v_akb_"+xx).reduce( function (a, b) {
return a + b * 1;
}, 0);
total += sum[x];
// rowGroup: {
// endRender: function ( rows, group, index ) {
// let sum = [];
// let sumReal = [];
// let total = 0;
// let totalReal = 0;
// for(let x=0;x<12;x++){
// xx = ("00"+(x+1));
// xx = xx.substring(xx.length - 2);
// sum[x] = rows.data().pluck("v_akb_"+xx).reduce( function (a, b) {
// return a + b * 1;
// }, 0);
// total += sum[x];
sumReal[x] = rows.data().pluck("v_bku_"+xx).reduce( function (a, b) {
return a + b * 1;
}, 0);
totalReal += sumReal[x];
}
let textmuted = index == 1 ? "text-muted":"";
let labelGroup = index == 1 ?"JUMLAH | " + group : "TOTAL";
return $("<tr/>")
.append( "<td></td>")
.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-success text-right'><strong>"+ separateNumberIndo(sumReal[0]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[1]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[1]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[2]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[2]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[3]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[3]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[4]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[4]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[5]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[5]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[6]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[6]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[7]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[7]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[8]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[8]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[9]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[9]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[10]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[10]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[11]) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[11]) +"</strong></td>" )
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(total) +"</strong></td>" )
.append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(totalReal) +"</strong></td>" )
},
startRender: function ( rows, group, index ) {
},
dataSrc: ["kode_skpd"]
},
// sumReal[x] = rows.data().pluck("v_bku_"+xx).reduce( function (a, b) {
// return a + b * 1;
// }, 0);
// totalReal += sumReal[x];
// }
// let textmuted = index == 1 ? "text-muted":"";
// let labelGroup = index == 1 ?"JUMLAH | " + group : "TOTAL";
// return $("<tr/>")
// .append( "<td></td>")
// .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-success text-right'><strong>"+ separateNumberIndo(sumReal[0]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[1]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[1]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[2]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[2]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[3]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[3]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[4]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[4]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[5]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[5]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[6]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[6]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[7]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[7]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[8]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[8]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[9]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[9]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[10]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[10]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sum[11]) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(sumReal[11]) +"</strong></td>" )
// .append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(total) +"</strong></td>" )
// .append( "<td class='text-success text-right'><strong>"+ separateNumberIndo(totalReal) +"</strong></td>" )
// },
// startRender: function ( rows, group, index ) {
// },
// dataSrc: ["kode_skpd"]
// },
scrollX: true,
scrollY: "350px",
});
});
</script>