Merge remote-tracking branch 'composer/feature/senior-officer' into staging
This commit is contained in:
@@ -1054,26 +1054,33 @@ class PenilaiController extends Controller
|
|||||||
$validatedData = $request->all();
|
$validatedData = $request->all();
|
||||||
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
$result = $this->inspeksiService->storeInspeksi($validatedData, $request->input('type'), $request);
|
||||||
|
|
||||||
|
$data = [];
|
||||||
|
|
||||||
$data = [
|
$kategoriUnik = ['tanah', 'bangunan', 'apartemen-kantor', 'alat-berat', 'mesin', 'kendaraan', 'pesawat', 'kapal', 'sarana_pelengkap_penilai'];
|
||||||
'luas_tanah' => $request->input('luas_tanah'),
|
|
||||||
'nilai_tanah_1' => $request->input('nilai_tanah_1'),
|
foreach ($kategoriUnik as $kategori) {
|
||||||
'nilai_tanah_2' => $request->input('nilai_tanah_2'),
|
// Dynamically generate keys
|
||||||
'luas_bangunan' => $request->input('luas_bangunan'),
|
$luasKey = 'luas_' . $kategori;
|
||||||
'nilai_bangunan_1' => $request->input('nilai_bangunan_1'),
|
$nilaiKey1 = 'nilai_' . $kategori . '_1';
|
||||||
'nilai_bangunan_2' => $request->input('nilai_bangunan_2'),
|
$nilaiKey2 = 'nilai_' . $kategori . '_2';
|
||||||
'sarana_pelengkap_penilai' => $request->input('sarana_pelengkap_penilai'),
|
|
||||||
'nilai_sarana_pelengkap_1' => $request->input('nilai_sarana_pelengkap_1'),
|
// Collect data if exists
|
||||||
'nilai_sarana_pelengkap_2' => $request->input('nilai_sarana_pelengkap_2'),
|
if ($request->has($luasKey)) {
|
||||||
'total_nilai_pasar_wajar' => $request->input('total_nilai_pasar_wajar'),
|
$data[$luasKey] = $request->input($luasKey);
|
||||||
'likuidasi' => $request->input('likuidasi'),
|
}
|
||||||
'likuidasi_nilai_1' => $request->input('likuidasi_nilai_1'),
|
if ($request->has($nilaiKey1)) {
|
||||||
'likuidasi_nilai_2' => $request->input('likuidasi_nilai_2'),
|
$data[$nilaiKey1] = $request->input($nilaiKey1);
|
||||||
'asuransi_luas_bangunan' => $request->input('asuransi_luas_bangunan'),
|
}
|
||||||
'asuransi_nilai_1' => $request->input('asuransi_nilai_1'),
|
if ($request->has($nilaiKey2)) {
|
||||||
'asuransi_nilai_2' => $request->input('asuransi_nilai_2'),
|
$data[$nilaiKey2] = $request->input($nilaiKey2);
|
||||||
'keterangan_penilai' => $request->input('keterangan_penilai') ?? [],
|
}
|
||||||
];
|
}
|
||||||
|
|
||||||
|
$data['total_nilai_pasar_wajar'] = $request->input('total_nilai_pasar_wajar');
|
||||||
|
$data['likuidasi'] = $request->input('likuidasi');
|
||||||
|
$data['likuidasi_nilai_1'] = $request->input('likuidasi_nilai_1');
|
||||||
|
$data['likuidasi_nilai_2'] = $request->input('likuidasi_nilai_2');
|
||||||
|
$data['keterangan_penilai'] = $request->input('keterangan_penilai') ?? [];
|
||||||
|
|
||||||
$npwData = [];
|
$npwData = [];
|
||||||
$npwCounter = 1;
|
$npwCounter = 1;
|
||||||
|
|||||||
@@ -91,37 +91,43 @@
|
|||||||
$luas = null;
|
$luas = null;
|
||||||
}
|
}
|
||||||
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
$luas = old('luas_' . $item, $lpjData['luas_' . $item] ?? $luas);
|
||||||
|
|
||||||
|
$luasKey = 'luas_' . $item;
|
||||||
|
$nilaiKey1 = 'nilai_' . $item . '_1';
|
||||||
|
$nilaiKey2 = 'nilai_' . $item . '_2';
|
||||||
@endphp
|
@endphp
|
||||||
@if (isset($labelNilai[$item]))
|
@if (isset($labelNilai[$item]))
|
||||||
<div class="flex grid-col-3 gap-2.5 w-full">
|
<div class="flex grid-col-3 gap-2.5 w-full">
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||||
<label for="province" class="form-label max-w-56">
|
<label for="province" class="form-label max-w-56">
|
||||||
{{ $labelNilai[$item] }}
|
{{ $labelNilai[$item] }}
|
||||||
</label>
|
</label>
|
||||||
<input type="text" id="luas_{{ $item }}" class="input w-full"
|
<input type="text" id="{{ $luasKey }}" class="input w-full"
|
||||||
name="luas_{{ $item }}" value="{{ $luas }}"
|
name="{{ $luasKey }}"
|
||||||
oninput="calculateTotal()">
|
value="{{ old($luasKey, $lpjData[$luasKey] ?? null) }}"
|
||||||
</div>
|
oninput="calculateTotal()">
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
</div>
|
||||||
<label for="province" class="">X</label>
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||||
<label class="input">
|
<label for="province" class="">X</label>
|
||||||
<i class="">Rp</i>
|
<label class="input">
|
||||||
<input type="text" id="nilai_{{ $item }}_1" class="w-full currency"
|
<i class="">Rp</i>
|
||||||
name="nilai_{{ $item }}_1"
|
<input type="text" id="{{ $nilaiKey1 }}" class="w-full currency"
|
||||||
value="{{ old('nilai_' . $item . '_1', $lpjData['nilai_' . $item . '_1'] ?? null) }}"
|
name="{{ $nilaiKey1 }}"
|
||||||
oninput="calculateTotal()">
|
value="{{ old($nilaiKey1, $lpjData[$nilaiKey1] ?? null) }}"
|
||||||
</label>
|
oninput="calculateTotal()">
|
||||||
</div>
|
</label>
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
</div>
|
||||||
<label class="input">
|
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||||
<i class="">Rp</i>
|
<label class="input">
|
||||||
<input id="nilai_{{ $item }}_2" type="text"
|
<i class="">Rp</i>
|
||||||
class="w-full currency-format" name="nilai_{{ $item }}_2"
|
<input id="{{ $nilaiKey2 }}" type="text"
|
||||||
value="{{ old('nilai_' . $item . '_2', $lpjData['nilai_' . $item . '_2'] ?? null) }}">
|
class="w-full currency-format"
|
||||||
</label>
|
name="{{ $nilaiKey2 }}"
|
||||||
</div>
|
value="{{ old($nilaiKey2, $lpjData[$nilaiKey2] ?? null) }}">
|
||||||
</div>
|
</label>
|
||||||
@endif
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
@@ -460,7 +466,10 @@
|
|||||||
// Get all kategori unik elements dynamically
|
// Get all kategori unik elements dynamically
|
||||||
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
const kategoriItems = document.querySelectorAll('[id^="luas_"]');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
kategoriItems.forEach(item => {
|
kategoriItems.forEach(item => {
|
||||||
|
console.log(item);
|
||||||
|
|
||||||
const kategori = item.id.replace('luas_', '');
|
const kategori = item.id.replace('luas_', '');
|
||||||
const luasInput = document.getElementById(`luas_${kategori}`);
|
const luasInput = document.getElementById(`luas_${kategori}`);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
<div class="w-full grid gap-5 lg:gap-7.5 mx-auto">
|
||||||
@if (Auth::user()->hasAnyRole(['senior-officer']))
|
@if (Auth::user()->hasAnyRole(['senior-officer', 'administrator','DD Appraisal', 'EO Appraisal']) && Request::is('penilai/lampiran'))
|
||||||
@include('lpj::component.detail-jaminan', [
|
@include('lpj::component.detail-jaminan', [
|
||||||
'backLink' => 'otorisator.view-laporan',
|
'backLink' => 'otorisator.view-laporan',
|
||||||
'queryParams' => [
|
'queryParams' => [
|
||||||
|
|||||||
@@ -182,7 +182,7 @@
|
|||||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) &&
|
||||||
$permohonan->approval_eo &&
|
$permohonan->approval_eo &&
|
||||||
$permohonan->approval_dd == 0 &&
|
$permohonan->approval_dd == 0 &&
|
||||||
in_array($permohonan->nilai_plafond_id, [1, 2, 4]))
|
in_array($permohonan->nilai_plafond_id, [4]))
|
||||||
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
<button onclick="otorisatorData({{ $permohonan->id }})" type="button" class="btn btn-primary">
|
||||||
<i class="ki-filled ki-double-check"></i>
|
<i class="ki-filled ki-double-check"></i>
|
||||||
Otorisator {{ $header ?? '' }}
|
Otorisator {{ $header ?? '' }}
|
||||||
@@ -224,7 +224,7 @@
|
|||||||
</button>
|
</button>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd == null && in_array($permohonan->nilai_plafond_id, [1, 4]))
|
@if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_eo && $authorization->approve_dd == null && in_array($permohonan->nilai_plafond_id, [4]))
|
||||||
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button"
|
<button onclick="otorisatorData({{ $authorization->id }},'DD')" type="button"
|
||||||
class="btn btn-primary">
|
class="btn btn-primary">
|
||||||
<i class="ki-filled ki-double-check"></i>
|
<i class="ki-filled ki-double-check"></i>
|
||||||
|
|||||||
Reference in New Issue
Block a user