diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index bdcee2b..40b94d9 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -56,9 +56,10 @@ class PenilaiController extends Controller $formFoto = null; if ($inpeksi) { $formFoto = json_decode($inpeksi->foto_form, true); + $forminspeksi = json_decode($inpeksi->data_form, true); } - return view('lpj::penilai.lampiran', compact('permohonan', 'formFoto')); + return view('lpj::penilai.lampiran', compact('permohonan', 'formFoto', 'forminspeksi')); } public function create() @@ -220,9 +221,10 @@ class PenilaiController extends Controller $formFoto = null; if ($inspeksi) { $formFoto = json_decode($inspeksi->foto_form, true); + $forminspeksi = json_decode($inspeksi->data_form, true); } - return view('lpj::penilai.components.paparan', compact('permohonan', 'formFoto', 'penilai')); + return view('lpj::penilai.components.paparan', compact('permohonan', 'formFoto', 'penilai', 'forminspeksi')); } @@ -663,7 +665,7 @@ class PenilaiController extends Controller try { if ($statusLpj) { - $html= view('lpj::' . $viewLaporan, compact( + $pdf= PDF::loadView('lpj::' . $viewLaporan, compact( 'permohonan', 'forminspeksi', 'lpjData', @@ -675,10 +677,10 @@ class PenilaiController extends Controller 'alamat', 'dataPembanding', 'nomorLaporan' - ))->render(); - - return response($html, 200)->header('Content-Type', 'text/html'); + )); + $pdf->setPaper('A4', 'portrait'); + return $pdf->stream(); } else { $pdf = PDF::loadView('lpj::' . $viewLaporan, compact( diff --git a/resources/views/component/detail-jaminan.blade.php b/resources/views/component/detail-jaminan.blade.php index d82f002..4eead8a 100644 --- a/resources/views/component/detail-jaminan.blade.php +++ b/resources/views/component/detail-jaminan.blade.php @@ -1,208 +1,213 @@ -
-
- @php - $title = $title ?? 'Data Permohonan'; - @endphp -

- {{ $title }} -

- -
- @if (isset($id)) - - Back - - @else - - Back - - @endif -
-
-
-
-

- Nomor Register Permohonan: +@if (!isset($status)) +
+
+ @php + $title = $title ?? 'Data Permohonan'; + @endphp +

+ {{ $title }}

- - {{ $permohonan->nomor_registrasi }} - -
-
-

- Pemohon: -

- - {{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }} - -
- -
-

- Tujan Permohonan: -

- - {{ $permohonan->tujuanPenilaian->name }} - -
- -
-

- Nilai Plafond: -

- - {{ $permohonan->nilaiPlafond->name }} - -
- -
-

- Status Bayar: -

- - {{ str_replace('_', ' ', $permohonan->status_bayar) }} - -
- -
-

- Nilai NJOP: -

- - {{ formatRupiah($permohonan->niilai_njop) }} - -
- -
-

- -
-
-

- Detail Debitur -

-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
- Name - - {{ $permohonan->debiture->name ?? '' }} -
- Email - - {{ $permohonan->debiture->email ?? '' }} -
- Phone - - {{ $permohonan->debiture->phone ?? '' }} -
- Address - - {{ $permohonan->debiture->address ?? '' }} -
-   - - {{ $permohonan->debiture->village->name ?? '' }}, - {{ $permohonan->debiture->district->name ?? '' }}, - {{ $permohonan->debiture->city->name ?? '' }}, - {{ $permohonan->debiture->province->name ?? '' }} - - {{ $permohonan->debiture->village->postal_code ?? '' }} -
+
+ @if (isset($id)) + + Back + + @else + + Back + + @endif
-
- - - - - - - - - - - - - - - - - -
- Cabang - - {{ $permohonan->debiture->branch->name ?? '' }} -
- CIF - - {{ $permohonan->debiture->cif ?? '' }} -
- Nomor Rekening - - {{ $permohonan->debiture->nomor_rekening ?? '' }} -
- NPWP - - {{ $permohonan->debiture->npwp ?? '' }} -
+
+
+
+

+ Nomor Register Permohonan: +

+ + {{ $permohonan->nomor_registrasi }} + +
+ +
+

+ Pemohon: +

+ + {{ $permohonan->user->nik }} | {{ $permohonan->user->name }} | {{ $permohonan->user->branch->name }} + +
+ +
+

+ Tujan Permohonan: +

+ + {{ $permohonan->tujuanPenilaian->name }} + +
+ +
+

+ Nilai Plafond: +

+ + {{ $permohonan->nilaiPlafond->name }} + +
+ +
+

+ Status Bayar: +

+ + {{ str_replace('_', ' ', $permohonan->status_bayar) }} + +
+ +
+

+ Nilai NJOP: +

+ + {{ formatRupiah($permohonan->niilai_njop) }} + +
+ +
+
+ +
+
+

+ Detail Debitur +

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
+ Name + + {{ $permohonan->debiture->name ?? '' }} +
+ Email + + {{ $permohonan->debiture->email ?? '' }} +
+ Phone + + {{ $permohonan->debiture->phone ?? '' }} +
+ Address + + {{ $permohonan->debiture->address ?? '' }} +
+   + + {{ $permohonan->debiture->village->name ?? '' }}, + {{ $permohonan->debiture->district->name ?? '' }}, + {{ $permohonan->debiture->city->name ?? '' }}, + {{ $permohonan->debiture->province->name ?? '' }} - + {{ $permohonan->debiture->village->postal_code ?? '' }} +
+
+
+ + + + + + + + + + + + + + + + + +
+ Cabang + + {{ $permohonan->debiture->branch->name ?? '' }} +
+ CIF + + {{ $permohonan->debiture->cif ?? '' }} +
+ Nomor Rekening + + {{ $permohonan->debiture->nomor_rekening ?? '' }} +
+ NPWP + + {{ $permohonan->debiture->npwp ?? '' }} +
+
-
-
-
-

- Data Jaminan -

-
-
- @foreach ($permohonan->debiture->documents as $dokumen) -
- - -
+
+
+

+ Data Jaminan +

+
+@endif +
+ @foreach ($permohonan->debiture->documents as $dokumen) +
+ +
+ @if (!isset($status))

@@ -242,78 +247,79 @@

-
- - Download Semua Dokumen - - - @foreach ($dokumen->detail as $detail) - - - - - - - + + + + + + @endforeach +
- {{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }} - - {{ $detail->name ?? '' }} -
- Dokumen Jaminan - + @endif +
+ + Download Semua Dokumen + + + @foreach ($dokumen->detail as $detail) + + + + + + + - - - - - - @endforeach -
+ {{ $loop->index + 1 }}. {{ $detail->jenisLegalitasJaminan->name }} + + {{ $detail->name ?? '' }} +
+ Dokumen Jaminan + - @if (isset($detail->dokumen_jaminan)) - @php - $dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) - ? json_decode($detail->dokumen_jaminan) - : [$detail->dokumen_jaminan]; - $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) - ? json_decode($detail->dokumen_nomor) - : ($detail->dokumen_nomor - ? [$detail->dokumen_nomor] - : []); - @endphp - @foreach ($dokumen_jaminan as $index => $dokumen) -
- @if (in_array(Auth::user()->roles[0]->name, ['administrator', 'pemohon-eo'])) - @if (!empty($dokumen_nomor)) - Nomor Dokumen : - {{ $dokumen_nomor[$index] }} - @endif - - {{ basename($dokumen) }} - - - @endif - Preview -
-
- @endforeach - @endif + @if (isset($detail->dokumen_jaminan)) + @php + $dokumen_jaminan = is_array(json_decode($detail->dokumen_jaminan)) + ? json_decode($detail->dokumen_jaminan) + : [$detail->dokumen_jaminan]; + $dokumen_nomor = is_array(json_decode($detail->dokumen_nomor)) + ? json_decode($detail->dokumen_nomor) + : ($detail->dokumen_nomor + ? [$detail->dokumen_nomor] + : []); + @endphp + @foreach ($dokumen_jaminan as $index => $dokumen) +
+ @if (in_array(Auth::user()->roles[0]->name, ['administrator', 'pemohon-eo'])) + @if (!empty($dokumen_nomor)) + Nomor Dokumen : + {{ $dokumen_nomor[$index] }} + @endif + + {{ basename($dokumen) }} + + + @endif + Preview +
+
+ @endforeach + @endif -
- Keterangan - - {{ $detail->keterangan ?? '' }} -
-
- +
+ Keterangan + + {{ $detail->keterangan ?? '' }} +
- @endforeach -
+
- -@include('lpj::component.history-permohonan') +@endforeach +
+@if (!isset($status)) +
+ @include('lpj::component.history-permohonan') +@endif @include('lpj::component.pdfviewer') diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php index 4143085..63cf99b 100644 --- a/resources/views/penilai/components/foto-jaminan.blade.php +++ b/resources/views/penilai/components/foto-jaminan.blade.php @@ -7,9 +7,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $item['path']) - : storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -27,9 +25,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $item['foto_rute_lainnya']) - : storage_path('app/public/' . $item['foto_rute_lainnya']); + $imagePath = storage_path('app/public/' . $item['foto_rute_lainnya']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_rute_lainnya']))) @@ -48,9 +44,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $item['foto_objek']) - : storage_path('app/public/' . $item['foto_objek']); + $imagePath = storage_path('app/public/' . $item['foto_objek']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['foto_objek']))) @@ -70,9 +64,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $item['path']) - : storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -91,9 +83,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $item['path']) - : storage_path('app/public/' . $item['path']); + $imagePath = storage_path('app/public/' . $item['path']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $item['path']))) @@ -110,9 +100,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $formFoto['foto_basement']) - : storage_path('app/public/' . $formFoto['foto_basement']); + $imagePath = storage_path('app/public/' . $formFoto['foto_basement']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_basement']))) @@ -128,9 +116,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $formFoto['foto_gerbang']) - : storage_path('app/public/' . $formFoto['foto_gerbang']); + $imagePath = storage_path('app/public/' . $formFoto['foto_gerbang']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['foto_gerbang']))) @@ -146,9 +132,7 @@ @php - $imagePath = $statusLpj - ? asset('storage/' . $formFoto['pendamping']) - : storage_path('app/public/' . $formFoto['pendamping']); + $imagePath = storage_path('app/public/' . $formFoto['pendamping']); @endphp @if ($statusLpj || file_exists(storage_path('app/public/' . $formFoto['pendamping']))) diff --git a/resources/views/penilai/components/foto-lampiran.blade.php b/resources/views/penilai/components/foto-lampiran.blade.php index a12a452..7d3ed81 100644 --- a/resources/views/penilai/components/foto-lampiran.blade.php +++ b/resources/views/penilai/components/foto-lampiran.blade.php @@ -13,7 +13,8 @@ {{ $item['name'] ?? 'Rute menuju lokasi - ' . ($index + 1) }}
- Gambar {{ $index + 1 }} + Gambar {{ $index + 1 }}
@@ -34,10 +35,11 @@

- {{ $item['name_rute_lainnya'] ?? 'Rute menuju lokasi - ' . ($index + 1) }} + {{ $item['name_rute_lainnya'] ?? 'Rute Lainnya - ' . ($index + 1) }}

- Gambar {{ $index + 1 }} + Gambar {{ $index + 1 }}
@@ -64,7 +66,8 @@
- +
@@ -80,22 +83,25 @@
@if (isset($formFoto['foto_lantai_unit'])) - @foreach ($formFoto['foto_lantai_unit'] as $floorNumber => $floorPhotos) + @foreach ($formFoto['foto_lantai_unit'] as $floorIndex => $floorPhotos)
@foreach ($floorPhotos as $index => $item)

- {{ $item['name'] ?? 'Foto Lantai ' . $floorNumber . ' - ' . ($index + 1) }} + {{ $item['name'] ?? 'Foto Lantai ' . ($floorIndex + 1) . ' - ' . ($index + 1) }}

- Gambar {{ $floorNumber }}-{{ $index + 1 }} + Gambar {{ $floorIndex + 1 }}-{{ $index + 1 }}
@endforeach
@endforeach + @endif
@@ -112,10 +118,11 @@

- {{ $item['name'] ?? 'Rute menuju lokasi - ' . ($index + 1) }} + {{ $item['name'] ?? 'Lingkungan - ' . ($index + 1) }}

- Gambar {{ $index + 1 }} + Gambar {{ $index + 1 }}
@@ -163,10 +170,11 @@

- {{ $item['name_lantai_lainnya'] ?? 'Rute menuju lokasi - ' . ($index + 1) }} + {{ $item['name_lantai_lainnya'] ?? 'Lantai - ' . ($index + 1) }}

- Gambar {{ $index + 1 }} + Gambar {{ $index + 1 }}
@@ -231,3 +239,39 @@
@endif + +
+
+

+ Peta +

+
+
+ @php + $fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat']; + if (($key = array_search('foto_tempat', $fotoTypes)) !== false) { + unset($fotoTypes[$key]); + array_unshift($fotoTypes, 'foto_tempat'); + } + @endphp +
+ @if (isset($forminspeksi)) + @forelse ($fotoTypes as $type) +
+ @php + $imagePath = $forminspeksi[$type] ?? null; + @endphp + + @if ($imagePath && file_exists(storage_path('app/public/' . $imagePath))) + {{ $type }} + @endif +

{{ Str::title(str_replace('_', ' ', $type)) }}

+
+ @empty +

Tidak ada tipe foto yang tersedia

+ @endforelse + @endif +
+
+
diff --git a/resources/views/penilai/components/lpj-sederhana-standard.blade.php b/resources/views/penilai/components/lpj-sederhana-standard.blade.php index d50e3ea..df198ae 100644 --- a/resources/views/penilai/components/lpj-sederhana-standard.blade.php +++ b/resources/views/penilai/components/lpj-sederhana-standard.blade.php @@ -106,7 +106,7 @@
- + {{ $forminspeksi['asset']['pihak_bank'] ?? '' }}
diff --git a/resources/views/penilai/components/print-out-sederhana.blade.php b/resources/views/penilai/components/print-out-sederhana.blade.php index b3159c3..a5ca8ea 100644 --- a/resources/views/penilai/components/print-out-sederhana.blade.php +++ b/resources/views/penilai/components/print-out-sederhana.blade.php @@ -5,7 +5,7 @@ - + Laporan Penilai Jaminan diff --git a/resources/views/surveyor/components/denah.blade.php b/resources/views/surveyor/components/denah.blade.php index 5431ef0..30a478a 100644 --- a/resources/views/surveyor/components/denah.blade.php +++ b/resources/views/surveyor/components/denah.blade.php @@ -29,97 +29,8 @@ -
- @foreach ($permohonan->debiture->documents as $dokumen) -
- - -
- @endforeach +
+ @include('lpj::component.detail-jaminan', ['status' => true])
diff --git a/resources/views/surveyor/components/header.blade.php b/resources/views/surveyor/components/header.blade.php index 2c6c71d..70ae2ee 100644 --- a/resources/views/surveyor/components/header.blade.php +++ b/resources/views/surveyor/components/header.blade.php @@ -256,96 +256,8 @@

Status

-
- @foreach ($permohonan->debiture->documents as $dokumen) -
- - - -
- @endforeach -
- - @include('lpj::component.pdfviewer') -
+ @include('lpj::component.detail-jaminan', ['status' => true]) +

Hubungan cadeb/debitur dengan Pemilik Jaminan