diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php
index 5262587..347d9c7 100644
--- a/app/Helpers/Lpj.php
+++ b/app/Helpers/Lpj.php
@@ -430,7 +430,8 @@ function getWilayahName($code, $type)
}
-function formatLabel($key) {
+function formatLabel($key)
+{
static $labelCache = [];
if (isset($labelCache[$key])) {
@@ -468,3 +469,35 @@ function calculateSLA($permohonan, $type)
return $slaMap[$type] ?? null;
}
+
+
+/**
+ * Menghitung total nilai berdasarkan key dan jenis legalitas.
+ *
+ * @param array $detailsArray
+ * @param string $key
+ * @param int $jenisLegalitas
+ * @return int
+ */
+function calculateTotalLuas($detailsArray, $key, $jenisLegalitas)
+{
+ $total = 0;
+
+ if ($detailsArray) {
+ foreach ($detailsArray as $item) {
+ if (isset($item->jenis_legalitas_jaminan_id) && $item->jenis_legalitas_jaminan_id === $jenisLegalitas) {
+ $details = json_decode($item->details, true);
+
+ if (is_array($details)) {
+ foreach ($details as $detail) {
+ if (isset($detail[$key])) {
+ $total += (int) $detail[$key];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return $total;
+}
diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php
index 5727369..eee3260 100644
--- a/app/Http/Controllers/PenilaiController.php
+++ b/app/Http/Controllers/PenilaiController.php
@@ -1290,6 +1290,8 @@ class PenilaiController extends Controller
// return $pdf;
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
$pdf->setPaper('A4', 'portrait');
+ $pdf->set_option('isHtml5ParserEnabled', true);
+ $pdf->set_option('isPhpEnabled', true);
return response($pdf->output(), 200)
->header('Content-Type', 'application/pdf')
->header('Content-Disposition', 'inline; filename="Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '.pdf"');
@@ -1317,6 +1319,8 @@ class PenilaiController extends Controller
// return $pdf;
$cleanNomorLaporan = str_replace(['/', '\\'], '-', $nomorLaporan);
$pdf->setPaper('A4', 'portrait');
+ $pdf->set_option('isHtml5ParserEnabled', true);
+ $pdf->set_option('isPhpEnabled', true);
return $pdf->download('Laporan_' . $tipeLaporan . '_' . $permohonan->debiture->name . '_' . $cleanNomorLaporan . '_data.pdf');
}
} catch (\Exception $e) {
diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php
index 67e7e5b..be1fc09 100644
--- a/app/Http/Controllers/SurveyorController.php
+++ b/app/Http/Controllers/SurveyorController.php
@@ -2436,16 +2436,19 @@ class SurveyorController extends Controller
$alamatKey = ($data['alamat_sesuai'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
$alamat = [];
+ $jenis_asset_key = ($data['jenis_asset'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
+ $jenis_asset = [];
+ $jenis_hasil = $jenis_asset_key === 'sesuai'
+ ? ($data['jenis_asset_name'] ?? null)
+ : ($data['jenis_asset_tidak_sesuai'] ?? null);
+ $jenis_asset[$jenis_asset_key] = $jenis_hasil;
+
// Masukkan key baru yang sesuai
$alamat[$alamatKey] = $alamatData;
return [
'asset' => [
'debitur_perwakilan' => $data['debitur_perwakilan'] ?? [],
- 'jenis_asset' => [
- $data['jenis_asset'] ?? null => ($data['jenis_asset'] ?? null) === 'sesuai'
- ? ($data['jenis_asset_name'] ?? null)
- : ($data['jenis_asset_tidak_sesuai'] ?? null)
- ],
+ 'jenis_asset' => $jenis_asset,
'alamat' => $alamat,
'hub_cadeb' => [
$data['hub_cadeb'] ?? null => ($data['hub_cadeb'] ?? null) === 'sesuai'
@@ -2470,7 +2473,6 @@ class SurveyorController extends Controller
private function getTanahData(array $data): array
{
//luas tanah key
- // Luas tanah key
$luas_tanah_key = ($data['luas_tanah'] ?? null) === 'sesuai' ? 'sesuai' : 'tidak sesuai';
$luas_tanah = [];
$hasil_tanah = $luas_tanah_key === 'sesuai'
@@ -3644,7 +3646,8 @@ class SurveyorController extends Controller
// Tentukan nama file PDF
$namaDebiture = $permohonan->debiture->name . '-' . $permohonan->nomor_registrasi;
$fileName = 'inspeksi-' . $namaDebiture . '-data.pdf';
-
+ $pdf->set_option('isHtml5ParserEnabled', true);
+ $pdf->set_option('isPhpEnabled', true);
return $pdf->stream($fileName);
}
diff --git a/resources/views/component/print-out-dokument.blade.php b/resources/views/component/print-out-dokument.blade.php
new file mode 100644
index 0000000..6faedd7
--- /dev/null
+++ b/resources/views/component/print-out-dokument.blade.php
@@ -0,0 +1,32 @@
+
+ @if (@isset($dokumen))
+ @foreach ($dokumen->detail as $detail)
+ @if (isset($detail->dokumen_jaminan))
+
+ | {{ $detail->name ?? '' }} |
+
+ @endif
+
+ @if (isset($detail->details))
+ @if (json_decode($detail->details))
+ @foreach (json_decode($detail->details) as $value)
+ @foreach ($value as $key => $item)
+
+ |
+ {{ formatLabel($key) }}
+ |
+ : |
+
+ {{ $item }}
+ @if ($key == 'luas_bangunan' || $key == 'luas_tanah')
+ m2
+ @endif
+ |
+
+ @endforeach
+ @endforeach
+ @endif
+ @endif
+ @endforeach
+ @endif
+
diff --git a/resources/views/penilai/components/analisa/apartement-kantor.blade.php b/resources/views/penilai/components/analisa/apartement-kantor.blade.php
index 77b57c5..78227a7 100644
--- a/resources/views/penilai/components/analisa/apartement-kantor.blade.php
+++ b/resources/views/penilai/components/analisa/apartement-kantor.blade.php
@@ -1,3 +1,4 @@
+
diff --git a/resources/views/penilai/components/analisa/bangunan.blade.php b/resources/views/penilai/components/analisa/bangunan.blade.php
index b78af1c..9725588 100644
--- a/resources/views/penilai/components/analisa/bangunan.blade.php
+++ b/resources/views/penilai/components/analisa/bangunan.blade.php
@@ -1,3 +1,4 @@
+
diff --git a/resources/views/penilai/components/analisa/fakta.blade.php b/resources/views/penilai/components/analisa/fakta.blade.php
index c5fc218..c9088cb 100644
--- a/resources/views/penilai/components/analisa/fakta.blade.php
+++ b/resources/views/penilai/components/analisa/fakta.blade.php
@@ -1,3 +1,4 @@
+
diff --git a/resources/views/penilai/components/analisa/informasi.blade.php b/resources/views/penilai/components/analisa/informasi.blade.php
index 6357a32..bc711cf 100644
--- a/resources/views/penilai/components/analisa/informasi.blade.php
+++ b/resources/views/penilai/components/analisa/informasi.blade.php
@@ -1,3 +1,4 @@
+
| Informasi Dinas Tata Ruang
@@ -58,3 +59,4 @@
|
@endif
+
diff --git a/resources/views/penilai/components/analisa/lingkungan.blade.php b/resources/views/penilai/components/analisa/lingkungan.blade.php
index 51c6200..cd37bdb 100644
--- a/resources/views/penilai/components/analisa/lingkungan.blade.php
+++ b/resources/views/penilai/components/analisa/lingkungan.blade.php
@@ -1,3 +1,4 @@
+
|
@@ -127,3 +128,4 @@
|
@endif
+
diff --git a/resources/views/penilai/components/analisa/tanah.blade.php b/resources/views/penilai/components/analisa/tanah.blade.php
index 890bf71..371fc4b 100644
--- a/resources/views/penilai/components/analisa/tanah.blade.php
+++ b/resources/views/penilai/components/analisa/tanah.blade.php
@@ -1,3 +1,4 @@
+
diff --git a/resources/views/penilai/components/footer.blade.php b/resources/views/penilai/components/footer.blade.php
index 84e9a94..1ded708 100644
--- a/resources/views/penilai/components/footer.blade.php
+++ b/resources/views/penilai/components/footer.blade.php
@@ -1,6 +1,110 @@
+
+
+
+
+
+ | Nama Debitur |
+ : |
+ {{ $permohonan->debiture->name ?? '' }} |
+
+
+ | Nomor Laporan |
+ : |
+ {{ $nomorLaporan }} |
+
+
+ | Tanggal Laporan |
+ : |
+ {{ formatTanggalIndonesia($tanggalLaporan) ?? '' }}
+ |
+
+
+
+
+ |
+ PETA DAN BLAD TATA RUANG
+ |
+
+
+
+ @php
+ $fotoTypes = [
+ 'upload_gs',
+ 'foto_sentuh_tanahku',
+ 'foto_gistaru',
+ 'foto_bhumi',
+ 'foto_argis_region',
+ 'foto_tempat',
+ ];
+
+ $customLabels = [
+ 'upload_gs' => 'Gambar Situasi',
+ 'foto_sentuh_tanahku' => 'Sentuh Tanahku',
+ 'foto_gistaru' => 'Gistaru',
+ 'foto_bhumi' => 'Bhumi',
+ 'foto_argis_region' => 'Blad Tata Ruang ',
+ 'foto_tempat' => 'Tempat',
+ ];
+ // Memindahkan foto_tempat ke depan jika ada
+ if (($key = array_search('upload_gs', $fotoTypes)) !== false) {
+ unset($fotoTypes[$key]);
+ array_unshift($fotoTypes, 'upload_gs');
+ }
+ // Filter fotoTypes untuk memastikan hanya yang memiliki imagePath valid
+ $validPhotoTypes = array_filter($fotoTypes, function ($type) use ($forminspeksi) {
+ return isset($forminspeksi[$type]) &&
+ file_exists(storage_path('app/public/' . $forminspeksi[$type]));
+ });
+ @endphp
+
+
+ @foreach ($validPhotoTypes as $type)
+ @php
+ $imagePath = $forminspeksi[$type] ?? null;
+ @endphp
+ @if ($imagePath && file_exists(storage_path('app/public/' . $imagePath)))
+
+ |
+
+ {{ $customLabels[$type] ?? '' }}
+
+
+ |
+
+ @endif
+ @endforeach
+
+
+
+
+
+
+ @include('lpj::penilai.components.foto-jaminan')
+
+
+
+