Update CHT
This commit is contained in:
@@ -55,7 +55,11 @@ class RealisasiBelanjaController extends Controller
|
||||
ON x.I_ID = y.I_IDSPD
|
||||
LEFT JOIN NEWSIPKD.TMDPASUBGIAT z
|
||||
ON y.I_IDSUBGIAT = z.I_ID
|
||||
WHERE z.C_SUBGIAT = \''.$DbhBelanjaRealisasi->kode_sub_kegiatan.'\'
|
||||
LEFT JOIN NEWSIPKD.TROPD a
|
||||
ON x.I_IDOPD = a.I_ID
|
||||
WHERE z.C_SUBGIAT = \''.$DbhBelanjaRealisasi->kode_sub_kegiatan.'\'
|
||||
AND a.C_OPD = \''.$DbhBelanjaRealisasi->kode_skpd.'\'
|
||||
AND x.C_ANGG_TAHUN = \''.$DbhBelanjaRealisasi->tahun_anggaran.'\'
|
||||
GROUP BY x.I_SPDNO_DOK,x.D_SPDNO
|
||||
ORDER BY x.D_SPDNO '
|
||||
));
|
||||
@@ -247,13 +251,21 @@ class RealisasiBelanjaController extends Controller
|
||||
if ($request->isMethod('post')) {
|
||||
try{
|
||||
DB::beginTransaction();
|
||||
$DbhBelanjaRealisasiDetail["dbh_belanja_realisasi_id"] = $id;
|
||||
$DbhBelanjaRealisasiDetail["volume_satuan_realisasi"] = $req["vol_realisasi"];
|
||||
$DbhBelanjaRealisasiDetail["unit_satuan_realisasi"] = $req["unit_realisasi"];
|
||||
$DbhBelanjaRealisasiDetail["jumlah_realisasi"] = replaceMoney($req["jml_realisasi"]);
|
||||
$DbhBelanjaRealisasiDetail["no_sp2d"] = $req["no_sp2d"];
|
||||
$DbhBelanjaRealisasiDetail["created_by"] = Auth::user()->id;
|
||||
DbhBelanjaRealisasiDetail::create($DbhBelanjaRealisasiDetail);
|
||||
|
||||
$DbhBelanjaRealisasiDetail = DbhBelanjaRealisasiDetail::where(["dbh_belanja_realisasi_id"=>$id,"no_sp2d"=>$req["no_sp2d"]]);
|
||||
$data["dbh_belanja_realisasi_id"] = $id;
|
||||
$data["volume_satuan_realisasi"] = $req["vol_realisasi"];
|
||||
$data["unit_satuan_realisasi"] = $req["unit_realisasi"];
|
||||
$data["jumlah_realisasi"] = replaceMoney($req["jml_realisasi"]);
|
||||
$data["no_sp2d"] = $req["no_sp2d"];
|
||||
$data["created_by"] = Auth::user()->id;
|
||||
// var_dump($DbhBelanjaRealisasiDetail->count()); exit;
|
||||
if ($DbhBelanjaRealisasiDetail->count()==0){
|
||||
DbhBelanjaRealisasiDetail::create($data);
|
||||
}else{
|
||||
$DbhBelanjaRealisasiDetail->firstorNew()->update($data);
|
||||
}
|
||||
|
||||
DB::commit();
|
||||
|
||||
return redirect($redirect)->with('success','Data Realisasi berhasil di input!');
|
||||
@@ -264,8 +276,20 @@ class RealisasiBelanjaController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$DbhBelanjaRealisasiDetail = DB::select(
|
||||
DB::raw('SELECT x.I_ID as IDSP2D, x.I_IDOPD,x.I_SP2DNO_DOK,TO_CHAR(x.D_SP2D_SAH,\'DD-MM-YYYY\') AS D_SP2D_SAH,x.V_SPP,
|
||||
a.no_sp2d,a.jumlah_realisasi,a.VOLUME_SATUAN_REALISASI,a.UNIT_SATUAN_REALISASI,a.ID
|
||||
FROM NEWSIPKD.TMSP2D x
|
||||
LEFT JOIN NEWSIPKD.TMSPPRINCIBLJRSK y
|
||||
ON x.I_IDSPP = y.I_IDSPP
|
||||
LEFT JOIN SAMASA.DBH_BELANJA_REALISASI_DETAIL a
|
||||
ON x.I_SP2DNO_DOK = a.NO_SP2D
|
||||
WHERE x.I_ID='.$request->id_sp2d.' ORDER BY x.D_SP2D_SAH ' )
|
||||
);
|
||||
$DbhBelanjaRealisasiDetail = $DbhBelanjaRealisasiDetail == null ? null : $DbhBelanjaRealisasiDetail[0];
|
||||
$unitSatuan = UnitSatuan::orderBy("id")->get();
|
||||
return view('realisasi_belanja.form_input_realisasi',compact("DbhBelanjaRealisasi", "unitSatuan","redirect"));
|
||||
|
||||
return view('realisasi_belanja.form_input_realisasi',compact("DbhBelanjaRealisasi", "DbhBelanjaRealisasiDetail", "unitSatuan","redirect"));
|
||||
}
|
||||
|
||||
public function datatableInputRealisasi(Request $request)
|
||||
@@ -276,14 +300,24 @@ class RealisasiBelanjaController extends Controller
|
||||
$src = isset($post["search"])?$post["search"]["value"]:"";
|
||||
|
||||
$dataFilter=0;
|
||||
$data = DbhBelanjaRealisasiDetail::where(["DBH_BELANJA_REALISASI_ID"=>$request->id])->orderBy("id","ASC");
|
||||
$dataFilter = $data->count();
|
||||
$dataTotal = DbhBelanjaRealisasiDetail::count();
|
||||
//$data = DbhBelanjaRealisasiDetail::where(["DBH_BELANJA_REALISASI_ID"=>$request->id])->orderBy("id","ASC");
|
||||
$data = DB::select(
|
||||
DB::raw('SELECT x.I_ID as IDSP2D, x.I_IDOPD,x.I_SP2DNO_DOK,TO_CHAR(x.D_SP2D_SAH,\'DD-MM-YYYY\') AS D_SP2D_SAH,x.V_SPP,
|
||||
a.no_sp2d,a.jumlah_realisasi,a.VOLUME_SATUAN_REALISASI,a.UNIT_SATUAN_REALISASI,a.ID
|
||||
FROM NEWSIPKD.TMSP2D x
|
||||
LEFT JOIN NEWSIPKD.TMSPPRINCIBLJRSK y
|
||||
ON x.I_IDSPP = y.I_IDSPP
|
||||
LEFT JOIN SAMASA.DBH_BELANJA_REALISASI_DETAIL a
|
||||
ON x.I_SP2DNO_DOK = a.NO_SP2D
|
||||
WHERE y.I_IDRSK = '.$request->id.' ORDER BY x.D_SP2D_SAH ' )
|
||||
);
|
||||
$dataFilter = count($data);
|
||||
$dataTotal = $dataFilter;
|
||||
|
||||
return response()->json([
|
||||
"recordsTotal" => $dataTotal,
|
||||
"recordsFiltered" => $dataFilter,
|
||||
"data"=> $data->skip($offset)->take($limit)->get()
|
||||
"data"=> $data
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,27 +12,28 @@
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label>No. SP2D</label>
|
||||
<input type="text" id="no_sp2d" required class="form-control" name="no_sp2d">
|
||||
<input type="text" id="no_sp2d" required class="form-control" name="no_sp2d" value="{{ $DbhBelanjaRealisasiDetail->i_sp2dno_dok }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12">
|
||||
<div class="form-group">
|
||||
<label>Jumlah Realisasi</label>
|
||||
<input type="text" id="jml_realisasi" required class="form-control" name="jml_realisasi" placeholder="Jumlah Realisasi" disabled>
|
||||
<input type="text" id="jml_realisasi" required class="form-control" name="jml_realisasi" placeholder="Jumlah Realisasi" value="{{ separateNumberIndo($DbhBelanjaRealisasiDetail->v_spp) }}" disabled>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
<?php $volSatuan = empty($DbhBelanjaRealisasi->volume_satuan_realisasi) ? $DbhBelanjaRealisasi->volume_satuan: $DbhBelanjaRealisasi->volume_satuan_realisasi; ?>
|
||||
<?php $volSatuan = empty($DbhBelanjaRealisasiDetail->volume_satuan_realisasi) ? 0: $DbhBelanjaRealisasiDetail->volume_satuan_realisasi; ?>
|
||||
<label>Volume Realisasi</label>
|
||||
<input type="number" id="vol_realisasi" required class="form-control" name="vol_realisasi" value="{{ $volSatuan }}" placeholder="Volume Realisasi" disabled>
|
||||
<input type="number" id="vol_realisasi" required class="form-control" name="vol_realisasi" value="{{ $volSatuan }}" placeholder="Volume Realisasi">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-6 col-sm-6 col-md-6">
|
||||
<div class="form-group">
|
||||
<label>Unit Realisasi</label>
|
||||
<select id="unit_realisasi" name="unit_realisasi" class="form-control" required placeholder="Unit Realisasi" disabled>
|
||||
<?php $unitSatuanVal = empty($DbhBelanjaRealisasi->unit_satuan_realisasi) ? $DbhBelanjaRealisasi->unit_satuan: $DbhBelanjaRealisasi->unit_satuan_realisasi; ?>
|
||||
<select id="unit_realisasi" name="unit_realisasi" class="form-control" required placeholder="Unit Realisasi">
|
||||
<option></option>
|
||||
<?php $unitSatuanVal = empty($DbhBelanjaRealisasiDetail->unit_satuan_realisasi) ? "": $DbhBelanjaRealisasiDetail->unit_satuan_realisasi; ?>
|
||||
<?php foreach($unitSatuan as $satuan){ ?>
|
||||
<option {{ $unitSatuanVal == $satuan->nama_satuan ? "selected":"" }}>{{ $satuan->nama_satuan }}</option>
|
||||
<?php } ?>
|
||||
@@ -82,6 +83,16 @@
|
||||
Swal.fire('Jumlah Realisasi kosong!!', '', 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($("#vol_realisasi").val() == 0){
|
||||
Swal.fire('Volume Realisasi kosong!!', '', 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($("#unit_realisasi").val() == ""){
|
||||
Swal.fire('Unit Realisasi kosong!!', '', 'error');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,70 +33,80 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="card-title"><i class="fa fa-th-list mr-2"></i> AKB dan SPD</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<strong>SPD</strong><hr>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<th>SPD No</th>
|
||||
<th>SPD Tgl</th>
|
||||
<th>Jumlah</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($vwSPD as $key=>$spd){ ?>
|
||||
<tr>
|
||||
<td>{{ $spd->i_spdno_dok }}</td>
|
||||
<td>{{ date("d-m-Y",strtotime($spd->d_spdno)) }}</td>
|
||||
<td>{{ separateNumberIndo($spd->jml) }}</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<strong>AKB</strong><hr>
|
||||
<strong><i class="fa fa-th-list mr-2"></i> AKB</strong><hr style="margin-bottom: 0 !important;">
|
||||
<div class="row">
|
||||
<?php foreach(GetBulan() as $key=>$bulan){ ?>
|
||||
<?= $key == 0 || $key == 6 ? "<div class='col-6'>":"" ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-form-label col-md-5 col-sm-5 label-align">{{ $bulan }}</label>
|
||||
<label class="col-form-label col-md-5 col-sm-5 label-align" style="{{ $key%2==0?"background: #f2f2f2":"" }}">{{ $bulan }}</label>
|
||||
<div class="col-md-7 col-sm-7 ">
|
||||
<input class="form-control-plaintext" value={{ separateNumberIndo($vwAKB["v_akb_".substr("00".($key+1),-2)]) }} readonly>
|
||||
<input class="form-control-plaintext text-right" style="{{ $key%2==0?"background: #f2f2f2":"" }}" value={{ separateNumberIndo($vwAKB["v_akb_".substr("00".($key+1),-2)]) }} readonly>
|
||||
</div>
|
||||
</div>
|
||||
<?= $key == 5 || $key == 11 ? "</div>":"" ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<strong><i class="fa fa-th-list mr-2"></i> SPD</strong><hr style="margin-bottom: 0 !important;">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<th>Nomor</th>
|
||||
<th>Tanggal</th>
|
||||
<th>Jumlah</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$totalSPD = 0;
|
||||
foreach($vwSPD as $key=>$spd){ ?>
|
||||
<tr>
|
||||
<td>{{ $spd->i_spdno_dok }}</td>
|
||||
<td>{{ date("d-m-Y",strtotime($spd->d_spdno)) }}</td>
|
||||
<td class="text-right">{{ separateNumberIndo($spd->jml) }}</td>
|
||||
</tr>
|
||||
<?php $totalSPD+=floatVal($spd->jml); } ?>
|
||||
<tr >
|
||||
<td colspan="2">Total</td>
|
||||
<td class="text-right"><strong>{{ separateNumberIndo($totalSPD) }}</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{{-- <div class="card-header">
|
||||
<h2 class="card-title"><i class="fa fa-th-list mr-2"></i> Realisasi</h2>
|
||||
<div class="card-tools">
|
||||
<?php if (Auth::user()->can("Input Realisasi DBH Realisasi Belanja")){ ?>
|
||||
<a class="btn btn-sm btn-success modalButton" title="Input Realisasi" href="{{ url('/dbh/realisasi-belanja/'.$DbhBelanjaRealisasi->id.'/inputRealisasi?redirect_link=/dbh/realisasi-belanja/'.$DbhBelanjaRealisasi->id.'/submit') }}"><i class="fa fa-paper-plane"></i> Input Realisasi</a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body table-responsive p-0">
|
||||
<table id="tblInputRealisasi" class="table table-striped jambo_table tblClickRow" style="width:100%;">
|
||||
<thead>
|
||||
</div> --}}
|
||||
<div class="card-body">
|
||||
<strong><i class="fa fa-th-list mr-2"></i> REALISASI</strong><hr style="margin-bottom: 0 !important;">
|
||||
<table id="tblInputRealisasi" class="table table-striped jambo_table tblClickRow" style="width:100%; margin-top:0 !important;">
|
||||
<thead>
|
||||
<tr class="headings">
|
||||
<th>No</th>
|
||||
<?php
|
||||
$arrCol = array(
|
||||
"No. SP2D",
|
||||
"No. SP2D",
|
||||
"Tanggal",
|
||||
"Jumlah Realisasi",
|
||||
"Volume Realisasi",
|
||||
"Unit Realisasi",
|
||||
"Aksi"
|
||||
);
|
||||
|
||||
if (!Auth::user()->can("Input Realisasi DBH Realisasi Belanja")){
|
||||
unset($arrCol[5]);
|
||||
}
|
||||
|
||||
foreach($arrCol as $rowCol){
|
||||
echo "<th>$rowCol</th>";
|
||||
}
|
||||
@@ -123,6 +133,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;
|
||||
@@ -171,7 +183,7 @@
|
||||
"ordering": false,
|
||||
"autoWidth": false,
|
||||
"ajax": {
|
||||
url: "/dbh/realisasi-belanja/{{ $DbhBelanjaRealisasi->id }}/inputrealisasi-datatable",
|
||||
url: "/dbh/realisasi-belanja/{{ $DbhBelanjaRealisasi->kode_rsk }}/inputrealisasi-datatable",
|
||||
type: "POST",
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
@@ -190,8 +202,9 @@
|
||||
"paging": true, // Table pagination
|
||||
"columns": [
|
||||
{ "data": null},
|
||||
{ "data": "no_sp2d", "className":"text-left", "defaultContent":"-"},
|
||||
{ "data": "jumlah_realisasi", "className":"text-right", "defaultContent":"0" },
|
||||
{ "data": "i_sp2dno_dok", "className":"text-center", "defaultContent":"-"},
|
||||
{ "data": "d_sp2d_sah", "className":"text-center", "defaultContent":"-"},
|
||||
{ "data": "v_spp", "className":"text-right", "defaultContent":"0" },
|
||||
{ "data": "volume_satuan_realisasi", "className":"text-center", "defaultContent":"0" },
|
||||
{ "data": "unit_satuan_realisasi", "className":"text-center", "defaultContent":"-" },
|
||||
{ "data": null}
|
||||
@@ -200,15 +213,13 @@
|
||||
let info = dtTable.page.info();
|
||||
let numStart = info.page;
|
||||
let index = (numStart * dtTable.page.len()) + iDisplayIndex + 1;
|
||||
//let btnInput = {{ empty(Auth::user()->can("Input Realisasi DBH Realisasi Belanja"))?"false":Auth::user()->can("Input Realisasi DBH Realisasi Belanja") }}?'<a class="btn btn-sm btn-default modalButton" title="Input Realisasi" href="/dbh/realisasi-belanja/'+aData["id"]+'/inputRealisasi"><i class="fa fa-edit"></i></a>':'';
|
||||
let btnInput = "";
|
||||
let btnInput = {{ empty(Auth::user()->can("Input Realisasi DBH Realisasi Belanja"))?"false":Auth::user()->can("Input Realisasi DBH Realisasi Belanja") }}?'<a class="btn btn-sm btn-default modalButton" title="Input Realisasi" href="/dbh/realisasi-belanja/{{ $DbhBelanjaRealisasi->id }}/inputRealisasi?id_sp2d='+aData["idsp2d"]+'&redirect_link=/dbh/realisasi-belanja/{{ $DbhBelanjaRealisasi->id }}/submit"><i class="fa fa-edit"></i></a>':'';
|
||||
//let btnDelete = {{ empty(Auth::user()->can("Input Realisasi DBH Realisasi Belanja"))?"false":Auth::user()->can("Input Realisasi DBH Realisasi Belanja") }}?'<a href="/dbh/realisasi-belanja/' + aData["id"] +'/submit" class="btn btn-sm btn-default mr-2"><i class="fa fa-trash"></i></a>':'';
|
||||
let btnDelete = {{ !empty(auth()->user()->can('Input Realisasi DBH Realisasi Belanja'))?auth()->user()->can('Input Realisasi DBH Realisasi Belanja'):"false" }} ?"<button type='submit' class='btn btn-default btn-sm ml-1' title='Hapus'><i class='fa fa-trash'></i></button>":"";
|
||||
//let btnDelete = {{ !empty(auth()->user()->can('Input Realisasi DBH Realisasi Belanja'))?auth()->user()->can('Input Realisasi DBH Realisasi Belanja'):"false" }} ?"<button type='submit' class='btn btn-default btn-sm ml-1' title='Hapus'><i class='fa fa-trash'></i></button>":"";
|
||||
|
||||
$("td:eq(0)", nRow).html(index);
|
||||
$("td:eq(2)", nRow).html(separateNumberIndo(aData["jumlah_realisasi"]));
|
||||
$("td:eq(5)", nRow).html("<form class='form-delete' action='/dbh/realisasi-belanja/delete-detail/"+aData['id']+"' method='POST'>"+
|
||||
"<input type='hidden' name='_token' id='csrf-token' value='{{ Session::token() }}' /><input type='hidden' name='_method' value='DELETE'>"+ btnDelete + "</form>");
|
||||
$("td:eq(3)", nRow).html(separateNumberIndo(aData["v_spp"]));
|
||||
$("td:eq(6)", nRow).html(btnInput);
|
||||
|
||||
return nRow;
|
||||
},
|
||||
@@ -225,6 +236,32 @@
|
||||
"processing": "<div class='loading'></div>",
|
||||
},
|
||||
scrollX:true,
|
||||
rowGroup: {
|
||||
endRender: function ( rows, group, index ) {
|
||||
let sumRealisasi = rows.data().pluck("jumlah_realisasi").reduce( function (a, b) {
|
||||
return a + b * 1;
|
||||
}, 0);
|
||||
|
||||
let sumVolume = rows.data().pluck("volume_satuan_realisasi").reduce( function (a, b) {
|
||||
return a + b * 1;
|
||||
}, 0);
|
||||
|
||||
let satuan = rows.data().pluck("unit_satuan_realisasi").reduce( function (a) {
|
||||
return a;
|
||||
});
|
||||
|
||||
let textmuted = index == 1 ? "text-muted":"";
|
||||
let labelGroup = index == 1 ?"JUMLAH | " + group : "TOTAL";
|
||||
return $("<tr/>")
|
||||
.append( "<td colspan='3'>TOTAL</td>")
|
||||
.append( "<td class=\'text-right " + textmuted +"\'><strong>"+ separateNumberIndo(sumRealisasi) +"</strong></td>")
|
||||
.append( "<td class=\'text-center " + textmuted +"\'><strong>"+ separateNumberIndo(sumVolume) +"</strong></td>" )
|
||||
.append( "<td class=\'text-center " + textmuted +"\'><strong>"+satuan+"</td><td></td>")
|
||||
},
|
||||
startRender: function ( rows, group, index ) {
|
||||
},
|
||||
dataSrc: ["i_idopd"]
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user