Merge remote-tracking branch 'origin/feature/senior-officer' into staging
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<div style="display: none">
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
||||
|
||||
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
||||
|
||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||
@@ -518,6 +519,13 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="form-label font-medium max-w-56">Nomor NIB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="nomor_nib" class="input w-full"
|
||||
value="{{ $forminspeksi['asset']['nomor_nib'] ?? '' }}" placeholder="Masukkan Nomor NIB">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -609,7 +617,7 @@
|
||||
{{ $labelNilai[$item] }}
|
||||
</label>
|
||||
<input type="text" id="luas_{{ $item }}"
|
||||
class="input w-full currency-format" name="luas_{{ $item }}"
|
||||
class="input w-full" name="luas_{{ $item }}"
|
||||
value="{{ old('luas_' . $item, $lpjData['luas_' . $item] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</div>
|
||||
@@ -618,7 +626,7 @@
|
||||
<label class="input">
|
||||
<i class="">Rp</i>
|
||||
<input type="text" id="nilai_{{ $item }}_1"
|
||||
class="w-full currency-format" name="nilai_{{ $item }}_1"
|
||||
class="w-full currency" name="nilai_{{ $item }}_1"
|
||||
value="{{ old('nilai_' . $item . '_1', $lpjData['nilai_' . $item . '_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
</label>
|
||||
@@ -752,7 +760,7 @@
|
||||
<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">
|
||||
<label for="province" class="form-label">Luas Bangunan</label>
|
||||
<input type="text" class="input w-full currency-format" id="asuransi_luas_bangunan"
|
||||
<input type="text" class="input w-full" id="asuransi_luas_bangunan"
|
||||
name="asuransi_luas_bangunan"
|
||||
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
@@ -762,7 +770,7 @@
|
||||
<label class="input">
|
||||
<i class="">Rp
|
||||
</i>
|
||||
<input type="text" class="input w-full currency-format" id="asuransi_nilai_1"
|
||||
<input type="text" class="input w-full currency" id="asuransi_nilai_1"
|
||||
name="asuransi_nilai_1"
|
||||
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}"
|
||||
oninput="calculateTotal()">
|
||||
@@ -788,6 +796,8 @@
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
|
||||
const tambahNPWButton = document.getElementById('tambah-npw');
|
||||
const addPasarWajarContainer = document.getElementById('add_pasar_wajar');
|
||||
let npwCounter = 0;
|
||||
@@ -807,7 +817,7 @@
|
||||
|
||||
<input type="text"
|
||||
id="luas_npw_${npwCounter}"
|
||||
class="input w-full currency-format"
|
||||
class="input w-full "
|
||||
name="luas_npw_${npwCounter}"
|
||||
placeholder="Luas NPW"
|
||||
oninput="calculateTotal()">
|
||||
@@ -819,7 +829,7 @@
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_1"
|
||||
class=" w-full currency-format"
|
||||
class=" w-full currency"
|
||||
name="nilai_npw_${npwCounter}_1"
|
||||
placeholder="Harga per meter"
|
||||
oninput="calculateTotal()">
|
||||
@@ -899,7 +909,7 @@
|
||||
</i>
|
||||
<input type="text"
|
||||
id="nilai_npw_${npwCounter}_1"
|
||||
class=" w-full currency-format"
|
||||
class=" w-full currency"
|
||||
name="nilai_npw_${npwCounter}_1"
|
||||
placeholder="Harga per meter"
|
||||
value="${npw.nilai_1 || ''}"
|
||||
@@ -953,6 +963,12 @@
|
||||
|
||||
// Panggil fungsi load NPW saat halaman dimuat
|
||||
loadSavedNPW();
|
||||
document.querySelectorAll('.currency-format').forEach(input => {
|
||||
input.addEventListener('input', function() {
|
||||
formatCurrency(this);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function calculateTotal() {
|
||||
@@ -974,17 +990,30 @@
|
||||
let totalNilaiPasarWajar = 0;
|
||||
|
||||
// Perhitungan untuk input yang sudah ada
|
||||
const standardInputs = [{
|
||||
luas: 'luas_tanah',
|
||||
nilai: 'nilai_tanah_1',
|
||||
output: 'nilai_tanah_2'
|
||||
},
|
||||
{
|
||||
const jenisAsetData = @json($jenisAset);
|
||||
|
||||
// Menentukan input yang akan dihitung berdasarkan jenis aset
|
||||
let standardInputs = [];
|
||||
|
||||
if (jenisAsetData.toUpperCase() === 'RUKO/RUKAN') {
|
||||
standardInputs = [{
|
||||
luas: 'luas_bangunan',
|
||||
nilai: 'nilai_bangunan_1',
|
||||
output: 'nilai_bangunan_2'
|
||||
}
|
||||
];
|
||||
}];
|
||||
} else {
|
||||
standardInputs = [{
|
||||
luas: 'luas_tanah',
|
||||
nilai: 'nilai_tanah_1',
|
||||
output: 'nilai_tanah_2'
|
||||
},
|
||||
{
|
||||
luas: 'luas_bangunan',
|
||||
nilai: 'nilai_bangunan_1',
|
||||
output: 'nilai_bangunan_2'
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
standardInputs.forEach(input => {
|
||||
let luas = parseInput(document.getElementById(input.luas).value);
|
||||
@@ -1083,5 +1112,18 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function formatCurrencyInput(input) {
|
||||
const value = input.value.replace(/[^0-9]/g, ''); // Hapus karakter non-angka
|
||||
if (!value) {
|
||||
input.value = ''; // Kosongkan jika tidak ada angka
|
||||
return;
|
||||
}
|
||||
|
||||
// Format ke mata uang
|
||||
const formattedValue = new Intl.NumberFormat('id-ID', { style: 'currency', currency: 'IDR' }).format(value);
|
||||
|
||||
input.value = formattedValue;
|
||||
}
|
||||
</script>
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
|
||||
@@ -331,7 +331,11 @@
|
||||
<td style="">
|
||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style="">{{ $value ?? '' }} <sup> m2</sup></td>
|
||||
<td style="">{{ $value ?? '' }}
|
||||
@if ($key == 'luas_tanah' || $key == 'luas_bangunan')
|
||||
M<sup>2</sup>
|
||||
@endif
|
||||
</td>
|
||||
@endforeach
|
||||
@endif
|
||||
@endif
|
||||
@@ -339,6 +343,11 @@
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td style=" padding: 2px;">Nomor NIB</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
<td style=" padding: 2px;">{{ $forminspeksi['asset']['nomor_nib']}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style=" padding: 2px;">Atas Nama</td>
|
||||
<td style=" padding: 2px;">:</td>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<div class=" card w-full bg-white rounded-lg shadow-md ">
|
||||
<div class="card-header bg-agi-50">
|
||||
@php
|
||||
$title = $title ?? 'Form Inspeksi';
|
||||
@endphp
|
||||
$title = $title ?? 'Form Inspeksi';
|
||||
@endphp
|
||||
<h3 class="card-title uppercase">
|
||||
{{ $title }}
|
||||
{{ $title }}
|
||||
</h3>
|
||||
<div class="flex items-center gap-2">
|
||||
@if (isset($id))
|
||||
<a href="{{ route($backLink, ['id' => $id]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ url()->previous() }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route($backLink, ['id' => $id]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@else
|
||||
<a href="{{ url()->previous() }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a>
|
||||
@endif
|
||||
{{-- <a href="{{ route('surveyor.show', ['id' => request('inspeksi')]) }}" class="btn btn-xs btn-info">
|
||||
<i class="ki-filled ki-exit-left"></i> Back
|
||||
</a> --}}
|
||||
@@ -264,8 +264,17 @@
|
||||
<div class="card-header bg-agi-50">
|
||||
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body w-full">
|
||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
||||
|
||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 w-full">
|
||||
<label class="form-label font-medium max-w-56">Nomor NIB</label>
|
||||
<div class="flex flex-wrap items-baseline w-full">
|
||||
<input type="text" name="nomor_nib" class="input w-full" value="{{ $forminspeksi['asset']['nomor_nib']}}"
|
||||
placeholder="Masukkan Nomor NIB">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class=" mx-auto rounded-lg overflow-hidden">
|
||||
<div class="py-4 ">
|
||||
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan</h1>
|
||||
@@ -562,4 +571,4 @@
|
||||
});
|
||||
// Fungsi untuk memuat data lokasi yang tersimpan
|
||||
</script>
|
||||
@include('lpj::surveyor.js.utils')
|
||||
@include('lpj::surveyor.js.utils')
|
||||
|
||||
Reference in New Issue
Block a user