perbaikan report rap dan dan penambahan no nib di pritn out sederhana
This commit is contained in:
@@ -600,7 +600,21 @@ class PenilaiController extends Controller
|
|||||||
|
|
||||||
$penilai = Penilai::where('permohonan_id', $id)->get();
|
$penilai = Penilai::where('permohonan_id', $id)->get();
|
||||||
|
|
||||||
|
$rap = $penilai->some(function ($item) {
|
||||||
|
return strtolower($item->type_penilai) === 'rap';
|
||||||
|
});
|
||||||
$allComplete = $penilai->every(function ($item) {
|
$allComplete = $penilai->every(function ($item) {
|
||||||
|
|
||||||
|
if ($item->type_penilai === 'rap') {
|
||||||
|
return !empty($item->type_penilai) && (
|
||||||
|
!empty($item->memo) ||
|
||||||
|
!empty($item->resume) ||
|
||||||
|
!empty($item->lpj) ||
|
||||||
|
!empty($item->rap)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return !empty($item->type_penilai) && (
|
return !empty($item->type_penilai) && (
|
||||||
!empty($item->memo) ||
|
!empty($item->memo) ||
|
||||||
!empty($item->resume) ||
|
!empty($item->resume) ||
|
||||||
@@ -625,8 +639,7 @@ class PenilaiController extends Controller
|
|||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'message' => 'Berhasil Megirim reported ke so',
|
'message' => 'Berhasil Megirim reported ke so'
|
||||||
'data' => $penilai,
|
|
||||||
], 200);
|
], 200);
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@@ -799,7 +812,8 @@ class PenilaiController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function storeRap(Request $request){
|
public function storeRap(Request $request)
|
||||||
|
{
|
||||||
DB::beginTransaction();
|
DB::beginTransaction();
|
||||||
try {
|
try {
|
||||||
$formRequest = new FormSurveyorRequest();
|
$formRequest = new FormSurveyorRequest();
|
||||||
|
|||||||
@@ -2375,6 +2375,7 @@ class SurveyorController extends Controller
|
|||||||
$data['hub_cadeb_penghuni'] => ($data['hub_cadeb_penghuni'] == 'sesuai') ? $data['hub_cadeb_penghuni_sesuai'] : $data['hub_penghuni_tidak_sesuai']
|
$data['hub_cadeb_penghuni'] => ($data['hub_cadeb_penghuni'] == 'sesuai') ? $data['hub_cadeb_penghuni_sesuai'] : $data['hub_penghuni_tidak_sesuai']
|
||||||
],
|
],
|
||||||
'pihak_bank' => $data['pihak_bank'] ?? null,
|
'pihak_bank' => $data['pihak_bank'] ?? null,
|
||||||
|
'nomor_nib' => $data['nomor_nib'] ?? null,
|
||||||
'kordinat_lng' => $data['kordinat_lng'] ?? null,
|
'kordinat_lng' => $data['kordinat_lng'] ?? null,
|
||||||
'kordinat_lat' => $data['kordinat_lat'] ?? null,
|
'kordinat_lat' => $data['kordinat_lat'] ?? null,
|
||||||
]
|
]
|
||||||
@@ -3181,4 +3182,56 @@ class SurveyorController extends Controller
|
|||||||
// Return Excel download
|
// Return Excel download
|
||||||
return Excel::download(new BasicDataSurveyorExport($modelClass), $type . '.xlsx');
|
return Excel::download(new BasicDataSurveyorExport($modelClass), $type . '.xlsx');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function signature()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function signatureStore(Request $request)
|
||||||
|
{
|
||||||
|
$validator = Validator::make($request->all(), [
|
||||||
|
'signature' => 'required',
|
||||||
|
'type' => 'required|in:penilai,cabang,debitur,kjjp',
|
||||||
|
'document_id' => 'nullable|string'
|
||||||
|
]);
|
||||||
|
|
||||||
|
if ($validator->fails()) {
|
||||||
|
return response()->json([
|
||||||
|
'success' => false,
|
||||||
|
'message' => $validator->errors()->first()
|
||||||
|
], 422);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hapus prefix data:image/png;base64,
|
||||||
|
$image = explode(',', $request->signature)[1];
|
||||||
|
$imageName = 'signatures/' . $request->type . '_' . time() . '.png';
|
||||||
|
|
||||||
|
// Simpan file
|
||||||
|
Storage::disk('public')->put($imageName, base64_decode($image));
|
||||||
|
$existingData = $inspeksi->exists && $inspeksi->foto_form
|
||||||
|
? json_decode($inspeksi->foto_form, true)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
$formatFotojson = $existingData;
|
||||||
|
$inspeksi = Inspeksi::save(
|
||||||
|
[
|
||||||
|
'permohonan_id' => $request->input('permohonan_id'),
|
||||||
|
'dokument_id' => $request->input('dokument_id')
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'data_form' => json_encode($processedData),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
public function signatureShow()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public function signatureDestroy()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -569,6 +569,7 @@ class FormSurveyorRequest extends FormRequest
|
|||||||
'permohonan_id' => 'required',
|
'permohonan_id' => 'required',
|
||||||
'type' => 'required',
|
'type' => 'required',
|
||||||
'nomor_registrasi' => 'required',
|
'nomor_registrasi' => 'required',
|
||||||
|
'nomor_nib' => 'nullable',
|
||||||
'debitur_perwakilan' => 'required|array',
|
'debitur_perwakilan' => 'required|array',
|
||||||
'jenis_asset_name' => 'nullable|',
|
'jenis_asset_name' => 'nullable|',
|
||||||
'jenis_asset' => 'required',
|
'jenis_asset' => 'required',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<div style="display: none">
|
<div style="display: none">
|
||||||
<div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5" style="margin-top: 20px">
|
<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>
|
<label class="form-label max-w-56">Debitur/Perwakilan</label>
|
||||||
|
|
||||||
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
@if (isset($forminspeksi['asset']['debitur_perwakilan']) && !empty($forminspeksi['asset']['debitur_perwakilan']))
|
||||||
@@ -518,6 +519,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
@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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -609,7 +617,7 @@
|
|||||||
{{ $labelNilai[$item] }}
|
{{ $labelNilai[$item] }}
|
||||||
</label>
|
</label>
|
||||||
<input type="text" id="luas_{{ $item }}"
|
<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) }}"
|
value="{{ old('luas_' . $item, $lpjData['luas_' . $item] ?? null) }}"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
</div>
|
</div>
|
||||||
@@ -618,7 +626,7 @@
|
|||||||
<label class="input">
|
<label class="input">
|
||||||
<i class="">Rp</i>
|
<i class="">Rp</i>
|
||||||
<input type="text" id="nilai_{{ $item }}_1"
|
<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) }}"
|
value="{{ old('nilai_' . $item . '_1', $lpjData['nilai_' . $item . '_1'] ?? null) }}"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
</label>
|
</label>
|
||||||
@@ -752,7 +760,7 @@
|
|||||||
<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">Luas Bangunan</label>
|
<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"
|
name="asuransi_luas_bangunan"
|
||||||
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}"
|
value="{{ old('asuransi_luas_bangunan', $lpjData['asuransi_luas_bangunan'] ?? null) }}"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
@@ -762,7 +770,7 @@
|
|||||||
<label class="input">
|
<label class="input">
|
||||||
<i class="">Rp
|
<i class="">Rp
|
||||||
</i>
|
</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"
|
name="asuransi_nilai_1"
|
||||||
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}"
|
value="{{ old('asuransi_nilai_1', $lpjData['asuransi_nilai_1'] ?? null) }}"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
@@ -788,6 +796,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
|
||||||
|
|
||||||
const tambahNPWButton = document.getElementById('tambah-npw');
|
const tambahNPWButton = document.getElementById('tambah-npw');
|
||||||
const addPasarWajarContainer = document.getElementById('add_pasar_wajar');
|
const addPasarWajarContainer = document.getElementById('add_pasar_wajar');
|
||||||
let npwCounter = 0;
|
let npwCounter = 0;
|
||||||
@@ -807,7 +817,7 @@
|
|||||||
|
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="luas_npw_${npwCounter}"
|
id="luas_npw_${npwCounter}"
|
||||||
class="input w-full currency-format"
|
class="input w-full "
|
||||||
name="luas_npw_${npwCounter}"
|
name="luas_npw_${npwCounter}"
|
||||||
placeholder="Luas NPW"
|
placeholder="Luas NPW"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
@@ -819,7 +829,7 @@
|
|||||||
</i>
|
</i>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="nilai_npw_${npwCounter}_1"
|
id="nilai_npw_${npwCounter}_1"
|
||||||
class=" w-full currency-format"
|
class=" w-full currency"
|
||||||
name="nilai_npw_${npwCounter}_1"
|
name="nilai_npw_${npwCounter}_1"
|
||||||
placeholder="Harga per meter"
|
placeholder="Harga per meter"
|
||||||
oninput="calculateTotal()">
|
oninput="calculateTotal()">
|
||||||
@@ -899,7 +909,7 @@
|
|||||||
</i>
|
</i>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
id="nilai_npw_${npwCounter}_1"
|
id="nilai_npw_${npwCounter}_1"
|
||||||
class=" w-full currency-format"
|
class=" w-full currency"
|
||||||
name="nilai_npw_${npwCounter}_1"
|
name="nilai_npw_${npwCounter}_1"
|
||||||
placeholder="Harga per meter"
|
placeholder="Harga per meter"
|
||||||
value="${npw.nilai_1 || ''}"
|
value="${npw.nilai_1 || ''}"
|
||||||
@@ -953,6 +963,12 @@
|
|||||||
|
|
||||||
// Panggil fungsi load NPW saat halaman dimuat
|
// Panggil fungsi load NPW saat halaman dimuat
|
||||||
loadSavedNPW();
|
loadSavedNPW();
|
||||||
|
document.querySelectorAll('.currency-format').forEach(input => {
|
||||||
|
input.addEventListener('input', function() {
|
||||||
|
formatCurrency(this);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function calculateTotal() {
|
function calculateTotal() {
|
||||||
@@ -974,7 +990,19 @@
|
|||||||
let totalNilaiPasarWajar = 0;
|
let totalNilaiPasarWajar = 0;
|
||||||
|
|
||||||
// Perhitungan untuk input yang sudah ada
|
// Perhitungan untuk input yang sudah ada
|
||||||
const standardInputs = [{
|
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',
|
luas: 'luas_tanah',
|
||||||
nilai: 'nilai_tanah_1',
|
nilai: 'nilai_tanah_1',
|
||||||
output: 'nilai_tanah_2'
|
output: 'nilai_tanah_2'
|
||||||
@@ -985,6 +1013,7 @@
|
|||||||
output: 'nilai_bangunan_2'
|
output: 'nilai_bangunan_2'
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
}
|
||||||
|
|
||||||
standardInputs.forEach(input => {
|
standardInputs.forEach(input => {
|
||||||
let luas = parseInput(document.getElementById(input.luas).value);
|
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>
|
</script>
|
||||||
@include('lpj::surveyor.js.utils')
|
|
||||||
|
|||||||
@@ -331,7 +331,11 @@
|
|||||||
<td style="">
|
<td style="">
|
||||||
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
{{ ucwords(str_replace('_', ' ', $key)) ?? '' }}</td>
|
||||||
<td style=" padding: 2px;">:</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
|
@endforeach
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
@@ -339,6 +343,11 @@
|
|||||||
@endforeach
|
@endforeach
|
||||||
@endif
|
@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>
|
<tr>
|
||||||
<td style=" padding: 2px;">Atas Nama</td>
|
<td style=" padding: 2px;">Atas Nama</td>
|
||||||
<td style=" padding: 2px;">:</td>
|
<td style=" padding: 2px;">:</td>
|
||||||
|
|||||||
@@ -264,8 +264,17 @@
|
|||||||
<div class="card-header bg-agi-50">
|
<div class="card-header bg-agi-50">
|
||||||
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
<h1 class="text-md font-medium text-gray-900 uppercase">Status</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body w-full">
|
||||||
@include('lpj::component.detail-jaminan', ['status' => true])
|
@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=" mx-auto rounded-lg overflow-hidden">
|
||||||
<div class="py-4 ">
|
<div class="py-4 ">
|
||||||
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan</h1>
|
<h1 class="text-md font-medium text-gray-900">Hubungan cadeb/debitur dengan Pemilik Jaminan</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user