update DAU
This commit is contained in:
@@ -91,19 +91,21 @@
|
||||
|
||||
$(document).on("submit","#frmRealBelanja",function (e){
|
||||
e.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Data akan disimpan?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$("select[name=rsk]").attr("disabled", false);
|
||||
e.currentTarget.submit();
|
||||
}
|
||||
})
|
||||
if (cekInputDAU()){
|
||||
Swal.fire({
|
||||
title: 'Data akan disimpan?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$("select[name=rsk]").attr("disabled", false);
|
||||
e.currentTarget.submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -94,20 +94,38 @@
|
||||
|
||||
$(document).on("submit","#frmRealBelanja",function (e){
|
||||
e.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Data akan disimpan?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
$("select[name=rsk]").attr("disabled", false);
|
||||
if (result.isConfirmed) {
|
||||
e.currentTarget.submit();
|
||||
}
|
||||
})
|
||||
if (cekInputDAU()){
|
||||
Swal.fire({
|
||||
title: 'Data akan disimpan?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
$("select[name=rsk]").attr("disabled", false);
|
||||
if (result.isConfirmed) {
|
||||
e.currentTarget.submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
let $newOpt = "";
|
||||
<?php foreach($BelanjaRealisasiRinciDau as $k=>$rinciDau){ ?>
|
||||
@php if ($k > 0){ @endphp
|
||||
$("#btnAddRinciDAU").click();
|
||||
@php } @endphp
|
||||
$($("input[name='dau[deskripsi_name][]']")[{{$k}}]).val("{{ $rinciDau->deskripsi }}");
|
||||
$($("input[name='dau[anggaran][]']")[{{$k}}]).val("{{ separateNumberIndo($rinciDau->jml_anggaran) }}");
|
||||
$($("input[name='dau[volume][]']")[{{$k}}]).val("{{ $rinciDau->volume_satuan }}");
|
||||
$($("select[name='dau[unit][]']")[{{$k}}]).val("{{ $rinciDau->unit_satuan }}");
|
||||
|
||||
$newOpt = $("<option selected='selected'></option>").val("{{ $rinciDau->id }}").text("{{ $rinciDau->deskripsi }}")
|
||||
$($("select[name='dau[deskripsi][]']")[{{$k}}]).val("{{ $rinciDau->id }}");
|
||||
$($("select[name='dau[deskripsi][]']")[{{$k}}]).append($newOpt).trigger('change');
|
||||
<?php } ?>
|
||||
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -87,7 +87,7 @@
|
||||
<div class="col-2">
|
||||
<div class="form-group">
|
||||
<label class="col-form-label label-align">Anggaran</label>
|
||||
<input type="text" class="form-control form-control-sm number-separator-indo" name="dau[anggaran][]" required>
|
||||
<input type="text" class="form-control form-control-sm number-separator-indo anggaran-dau" name="dau[anggaran][]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@@ -128,6 +128,9 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#divDAU").hide();
|
||||
$("#divDAU input, #divDAU select").prop("disabled", true);
|
||||
|
||||
$('select[name=jenis]').on('select2:select', function (e) {
|
||||
var data = e.params.data;
|
||||
subJenisBelanja(data.id);
|
||||
@@ -140,8 +143,10 @@
|
||||
subJenisDana($(this).val());
|
||||
jenisBelanja($(this).val());
|
||||
$("#divDAU").hide();
|
||||
$("#divDAU input").prop("disabled", true);
|
||||
if ($(this).val()=="DAU"){
|
||||
$("#divDAU").show();
|
||||
$("#divDAU input, #divDAU select").prop("disabled", false);
|
||||
}
|
||||
})
|
||||
|
||||
@@ -163,7 +168,7 @@
|
||||
<div class="col-2">
|
||||
<div class="form-group">
|
||||
<label class="col-form-label label-align">Anggaran</label>
|
||||
<input type="text" class="form-control form-control-sm number-separator-indo" name="dau[anggaran][]" required>
|
||||
<input type="text" class="form-control form-control-sm number-separator-indo anggaran-dau" name="dau[anggaran][]" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
@@ -201,5 +206,21 @@
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
var cekInputDAU = function(){
|
||||
if ($("#jenis_dana").val()=="DAU"){
|
||||
let jmlAnggaran = 0;
|
||||
for(let x=0;x<$(".anggaran-dau").length;x++){
|
||||
jmlAnggaran += parseFloat(replaceValue($($(".anggaran-dau")[x]).val()));
|
||||
}
|
||||
|
||||
if (jmlAnggaran != parseFloat(replaceValue($("input[name=anggaran]").val()))){
|
||||
Swal.fire("Info","Jumlah Perincian tidak sama dengan Anggaran!","error")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
@@ -195,10 +195,6 @@
|
||||
});
|
||||
|
||||
$("#divDAU").remove();
|
||||
|
||||
$(document).on("click","#btnSimpanDau",function(){
|
||||
$("#frmDAU").submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
@@ -82,9 +82,6 @@
|
||||
</div>
|
||||
<div class="tab-pane fade" id="custom-tabs-four-detail" role="tabpanel" aria-labelledby="custom-tabs-four-detail-tab">
|
||||
<h5>Detail Per-bulan</h5>
|
||||
<?php if (Auth::user()->can("Input Realisasi DBH Realisasi Belanja")){ ?>
|
||||
<a class="modalButton float-left" title="Input Rincian" href="{{ url('/realisasi-belanja/'.$BelanjaRealisasi->id.'/inputRealisasi?type=rinci&redirect_link=/realisasi-belanja/'.$BelanjaRealisasi->id.'/submit') }}"><i class="fa fa-paper-plane"></i> Input Rincian</a>
|
||||
<?php } ?>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -110,6 +107,9 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (Auth::user()->can("Input Realisasi DBH Realisasi Belanja")){ ?>
|
||||
<a class="modalButton btn btn-success mb-2" title="Input Rincian" href="{{ url('/realisasi-belanja/'.$BelanjaRealisasi->id.'/inputRealisasi?type=rinci&redirect_link=/realisasi-belanja/'.$BelanjaRealisasi->id.'/submit') }}"><i class="fa fa-paper-plane"></i> Input Rincian</a>
|
||||
<?php } ?>
|
||||
<hr>
|
||||
<div id="detail_dau">
|
||||
<h5>Detail DAU</h5>
|
||||
@@ -133,17 +133,17 @@
|
||||
<tr>
|
||||
<td>{{ ($k+1) }}</td>
|
||||
<td>{{ $rinciDau->deskripsi }}</td>
|
||||
<td>{{ number_format($rinciDau->jml_anggaran) }}</td>
|
||||
<td>{{ separateNumberIndo($rinciDau->jml_anggaran) }}<input class="input_dau_anggaran" type="hidden" value="{{ $rinciDau->jml_anggaran }}"></td>
|
||||
<td>{{ $rinciDau->volume_satuan }}</td>
|
||||
<td>{{ $rinciDau->unit_satuan }}</td>
|
||||
<td>
|
||||
<input type="hidden" name="dau[id][]" value="{{ $rinciDau->id }}">
|
||||
<input type="text" class="form-control form-control-sm" name="dau[realisasi][]" value="{{ $rinciDau->jml_realisasi }}">
|
||||
<input type="text" class="form-control form-control-sm number-separator-indo input_dau input_dau_realisasi" name="dau[realisasi][]" value="{{ separateNumberIndo($rinciDau->jml_realisasi) }}">
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" class="form-control form-control-sm" name="dau[volume_realisasi][]" value="{{ $rinciDau->volume_satuan_realisasi }}"></td>
|
||||
<input type="number" class="form-control form-control-sm input_dau" name="dau[volume_realisasi][]" value="{{ $rinciDau->volume_satuan_realisasi }}"></td>
|
||||
<td>
|
||||
<select name="dau[unit_realisasi][]" class="form-control form-control-sm " required placeholder="Unit Realisasi">
|
||||
<select name="dau[unit_realisasi][]" class="form-control form-control-sm input_dau" required placeholder="Unit Realisasi">
|
||||
<?php foreach($unitSatuan as $satuan){ ?>
|
||||
<option value="{{ $satuan->nama_satuan }}" {{ $rinciDau->unit_satuan_realisasi == $satuan->nama_satuan?"selected":"" }}>{{ $satuan->nama_satuan }}</option>
|
||||
<?php } ?>
|
||||
@@ -154,9 +154,55 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<button id="btnSimpanDau" type="button" class="btn btn-success">Simpan Data</button>
|
||||
<button id="btnSimpanDau" type="button" class="btn btn-success"><i class="fa fa-save"></i> Simpan Data</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
$(document).on("click","#btnSimpanDau",function(){
|
||||
let cancel = false;
|
||||
let msg="";
|
||||
for(let x=0;x<$(".input_dau").length;x++){
|
||||
if ($($(".input_dau")[x]).val()==""){
|
||||
cancel = true;
|
||||
msg = "Input masih ada yang kosong!";
|
||||
}
|
||||
}
|
||||
|
||||
for(let x=0;x<$(".input_dau_realisasi").length;x++){
|
||||
if ($($(".input_dau_anggaran")[x]).val()<parseFloat(replaceValue($($(".input_dau_realisasi")[x]).val()))){
|
||||
msg = "Jumlah Perincian tidak sama atau kurang dengan Anggaran!";
|
||||
cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (cancel){
|
||||
Swal.fire("Info",msg,"error")
|
||||
}else{
|
||||
Swal.fire({
|
||||
title: 'Detail Rinci DAU akan disimpan?',
|
||||
showDenyButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: 'Ya',
|
||||
denyButtonText: "Tidak",
|
||||
icon: "warning",
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$("#frmDAU").submit();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
<?php if (!Auth::user()->can("Input Realisasi DBH Realisasi Belanja")){ ?>
|
||||
$(".input_dau").attr("disabled", true);
|
||||
$("#btnSimpanDau").remove();
|
||||
<?php } ?>
|
||||
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user