diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php
index 7e95fce..66ee6d8 100644
--- a/app/Http/Controllers/PenilaiController.php
+++ b/app/Http/Controllers/PenilaiController.php
@@ -13,6 +13,7 @@ use Maatwebsite\Excel\Facades\Excel;
use Modules\Lpj\Exports\KertasKerjaExport;
use Modules\Lpj\Http\Controllers\SurveyorController;
use Modules\Location\Models\Province;
+use Illuminate\Support\Facades\Log;
class PenilaiController extends Controller
{
@@ -243,10 +244,13 @@ class PenilaiController extends Controller
}
- $query->whereHas('penilaian.userPenilai', function ($q) {
- $q->where('role', 'penilai')
- ->where('user_id', Auth::user()->id);
- });
+ if(!Auth::user()->hasRole('administrator')) {
+ $query->whereHas('penilaian.userPenilai', function ($q) {
+ $q
+ ->where('role', 'penilai')
+ ->where('user_id', Auth::user()->id);
+ });
+ }
// Apply sorting if provided
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
@@ -604,20 +608,24 @@ class PenilaiController extends Controller
$lpjData = json_decode($lpj->lpj, true);
}
+ try {
+ $pdf = PDF::loadView('lpj::penilai.components.print-out', compact(
+ 'permohonan',
+ 'forminspeksi',
+ 'lpjData',
+ 'formFoto',
+ 'basicData',
+ 'inspeksi',
+ 'lpj'
+ ));
- $pdf = PDF::loadView('lpj::penilai.components.print-out', compact(
- 'permohonan',
- 'forminspeksi',
- 'lpjData',
- 'formFoto',
- 'basicData',
- 'inspeksi',
- 'lpj'
- ));
+ $pdf->setPaper('A4', 'portrait');
- $pdf->setPaper('A4', 'portrait');
-
- return $pdf->download('laporan.pdf');
+ return $pdf->download('laporan.pdf');
+ } catch (\Exception $e) {
+ Log::error('PDF generation failed: ' . $e->getMessage());
+ return response()->json(['error' => 'Failed to generate PDF. Please check the log for details.'], 500);
+ }
// return view('lpj::penilai.components.print-out', compact(
// 'permohonan',
diff --git a/app/Http/Controllers/PenilaianController.php b/app/Http/Controllers/PenilaianController.php
index 0013891..1599ac8 100644
--- a/app/Http/Controllers/PenilaianController.php
+++ b/app/Http/Controllers/PenilaianController.php
@@ -536,7 +536,7 @@
$filteredRecords = $query->count();
// Ambil data dengan relasi
- $data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'region.teams.teamsUsers'])->get();
+ $data = $query->with(['user', 'debiture', 'branch', 'tujuanPenilaian', 'approveSo'])->get();
// Hitung jumlah halaman
diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php
index cdf6f97..d74c0a7 100644
--- a/app/Http/Controllers/SurveyorController.php
+++ b/app/Http/Controllers/SurveyorController.php
@@ -1412,10 +1412,12 @@ class SurveyorController extends Controller
$query->whereRaw('LOWER(status) = ?', ['assign']);
- $query->whereHas('penilaian.userPenilai', function ($q) {
- $q->where('user_id', Auth::user()->id);
- $q->where('role', 'surveyor');
- });
+ if(!Auth::user()->hasRole('administrator')) {
+ $query->whereHas('penilaian.userPenilai', function ($q) {
+ $q->where('user_id', Auth::user()->id);
+ $q->where('role', 'surveyor');
+ });
+ }
if ($request->has('sortOrder') && !empty($request->get('sortOrder'))) {
diff --git a/app/Models/Permohonan.php b/app/Models/Permohonan.php
index eac4ad8..0ed5c0a 100644
--- a/app/Models/Permohonan.php
+++ b/app/Models/Permohonan.php
@@ -193,4 +193,16 @@
public function approveBayar(){
return $this->belongsTo(User::class, 'approve_bayar_by', 'id');
}
+
+ public function approveEo(){
+ return $this->belongsTo(User::class, 'approval_eo', 'id');
+ }
+
+ public function approveDd(){
+ return $this->belongsTo(User::class, 'approval_dd', 'id');
+ }
+
+ public function approveSo(){
+ return $this->belongsTo(User::class, 'approval_so', 'id');
+ }
}
diff --git a/module.json b/module.json
index dd16ad9..15e7edd 100644
--- a/module.json
+++ b/module.json
@@ -245,7 +245,9 @@
"permission": "",
"roles": [
"administrator",
- "senior-officer"
+ "senior-officer",
+ "EO Appraisal",
+ "DD Appraisal"
],
"sub": [
{
diff --git a/resources/views/penilai/components/print-out.blade.php b/resources/views/penilai/components/print-out.blade.php
index cdf906b..d2c5438 100644
--- a/resources/views/penilai/components/print-out.blade.php
+++ b/resources/views/penilai/components/print-out.blade.php
@@ -214,229 +214,229 @@
-
-
+
+
-
-
-
-
- |
- A
- |
-
- TUJUAN PENILAIAN
- |
-
-
-
-
+
+
+
-
-
-
- | Permintaan (A/O) |
- {{ $permohonan->user->name }} |
-
-
- | Jenis Fasilitas |
- {{ $permohonan->tujuanPenilaian->name }} |
-
-
+ |
+ A
|
-
-
-
- | Tanggal |
- {{ $permohonan->created_at->format('d/m/Y') }} |
-
-
- | Kunjungan Tanggal |
- {{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }} |
-
-
- |
-
-
-
- |
- @if (isset($basicData['tujuanPenilaian']))
-
- |
-
- @endif
-
-
-
-
-
-
-
- |
- B
- |
-
- IDENTITAS DEBITUR
- |
-
-
-
-
-
- | Nama Debitur |
- {{ $permohonan->debiture->name ?? '' }} |
-
-
- | Alamat dan Telepon |
- {{ $permohonan->debiture->address ?? '' }} {{ $permohonan->debiture->phone ?? '' }} |
-
-
- | Saat menilai, penilai didampingi oleh |
-
-
-
- | Debitur / Wakil Debitur |
- {{ $permohonan->debiture->name ?? '' }} |
-
-
- | Pihak Bank selain PJ |
- |
-
-
+ |
+ TUJUAN PENILAIAN
|
+
+
+
+
+
+ | Permintaan (A/O) |
+ {{ $permohonan->user->name }} |
+
+
+ | Jenis Fasilitas |
+ {{ $permohonan->tujuanPenilaian->name }} |
+
+
+ |
+
+
+
+ | Tanggal |
+ {{ $permohonan->created_at->format('d/m/Y') }} |
+
+
+ | Kunjungan Tanggal |
+ {{ formatTanggalIndonesia($permohonan->penilaian->tanggal_kunjungan) }} |
+
+
+ |
+
-
-
-
-
- |
- C
- |
-
- JENIS JAMINAN
- |
-
-
-
-
- @php
- $data = '';
- foreach ($permohonan->debiture->documents as $dokumen) {
- $data .= $dokumen->jenisJaminan->name . ', ';
- }
- $data = rtrim($data, ', '); // Remove the trailing comma and space
- @endphp
-
- @if (isset($basicData['jenisJaminan']))
-
+
+ |
+ @if (isset($basicData['tujuanPenilaian']))
+
+ |
+
@endif
-
+
+
-
-
-
-
-
- |
- D
- |
-
- LOKASI JAMINAN
- |
-
-
-
-
+
+
+
- | Terletak di |
- {{ $dokumen->pemilik->address ?? '' }} |
-
-
- | Kelurahan |
- {{ $dokumen->pemilik->village->name ?? '' }} |
-
-
- | Kecamatan |
- {{ $dokumen->pemilik->district->name ?? '' }}, |
-
-
- | Kotamadya |
- {{ $dokumen->pemilik->city->name ?? '' }}, |
-
-
- | Propinsi |
- {{ $dokumen->pemilik->province->name ?? '' }} |
+
+ B
+ |
+
+ IDENTITAS DEBITUR
+ |
+
+
+
+ | Nama Debitur |
+ {{ $permohonan->debiture->name ?? '' }} |
+
+
+ | Alamat dan Telepon |
+ {{ $permohonan->debiture->address ?? '' }} {{ $permohonan->debiture->phone ?? '' }} |
+
+
+ | Saat menilai, penilai didampingi oleh |
+
+
+
+ | Debitur / Wakil Debitur |
+ {{ $permohonan->debiture->name ?? '' }} |
+
+
+ | Pihak Bank selain PJ |
+ |
+
+
+ |
+
+
+
+
+
+
+
+ |
+ C
+ |
+
+ JENIS JAMINAN
+ |
+
+
-
-
-
-
- |
- E
- |
-
- STATUS KEPEMILIKAN, HUBUNGAN DAN PENGHUNI
- |
-
-
-
+ @php
+ $data = '';
+ foreach ($permohonan->debiture->documents as $dokumen) {
+ $data .= $dokumen->jenisJaminan->name . ', ';
+ }
+ $data = rtrim($data, ', '); // Remove the trailing comma and space
+ @endphp
-
+ @if (isset($basicData['jenisJaminan']))
+
+ @endif
+
+
+
+
+
+
- | SHM No/Kelurahan/Desa |
- {{ $dokumen->pemilik->address ?? '' }} |
+
+ D
+ |
+
+ LOKASI JAMINAN
+ |
+
+
+
+
+ | Terletak di |
+ {{ $dokumen->pemilik->address ?? '' }} |
+
+
+ | Kelurahan |
+ {{ $dokumen->pemilik->village->name ?? '' }} |
+
+
+ | Kecamatan |
+ {{ $dokumen->pemilik->district->name ?? '' }}, |
+
+
+ | Kotamadya |
+ {{ $dokumen->pemilik->city->name ?? '' }}, |
+
+
+ | Propinsi |
+ {{ $dokumen->pemilik->province->name ?? '' }} |
+
+
+
+
+
+
+
+
- | Tanggal |
- {{ $dokumen->pemilik->created_at->format('d-m-Y') ?? '' }} |
+
+ E
+ |
+
+ STATUS KEPEMILIKAN, HUBUNGAN DAN PENGHUNI
+ |
-
- | Atas Nama |
- {{ $dokumen->pemilik->name ?? '' }} |
-
-
- | Gambar Situasi No/Tanggal |
- |
-
-
- | Luas Tanah /m2 |
- {{ $dokumen->luas_tanah ?? '' }} |
-
-
- | IMB No/Tanggal |
- {{ $dokumen->imb_no ?? '' }} |
-
-
- @php
+
+
+
+
+
+ | SHM No/Kelurahan/Desa |
+ {{ $dokumen->pemilik->address ?? '' }} |
+
+
+ | Tanggal |
+ {{ $dokumen->pemilik->created_at->format('d-m-Y') ?? '' }} |
+
+
+ | Atas Nama |
+ {{ $dokumen->pemilik->name ?? '' }} |
+
+
+ | Gambar Situasi No/Tanggal |
+ |
+
+
+ | Luas Tanah /m2 |
+ {{ $dokumen->luas_tanah ?? '' }} |
+
+
+ | IMB No/Tanggal |
+ {{ $dokumen->imb_no ?? '' }} |
+
+
+ @php
$cekHub =
isset($forminspeksi['asset']['hub_cadeb']) &&
@@ -448,21 +448,23 @@
? $forminspeksi['asset']['hub_cadeb']['tidak sesuai']
: $forminspeksi['asset']['hub_cadeb']['sesuai'];
@endphp
- | Hubungan Pemilik Jaminan dengan Debitur |
-
- @if (isset($basicData['hubCadeb']))
-
- @endif
- |
-
-
- @php
+ | Hubungan Pemilik Jaminan dengan Debitur |
+
+ @if (isset($basicData['hubCadeb']))
+
+ @endif
+ |
+
+
+ @php
$cekHub =
isset($forminspeksi['asset']['hub_cadeb_penghuni']) &&
@@ -474,78 +476,80 @@
? $forminspeksi['asset']['hub_cadeb_penghuni']['tidak sesuai']
: $forminspeksi['asset']['hub_cadeb_penghuni']['sesuai'];
@endphp
- | Hubungan Penghuni Jaminan dengan Debitur |
-
- @if (isset($basicData['hubPenghuni']))
-
- @endif
+ | Hubungan Penghuni Jaminan dengan Debitur |
+
+ @if (isset($basicData['hubPenghuni']))
+
+ @endif
+ |
+
+
+
+
+
+
+
+
+
+
+ |
+ F
+ |
+
+ ANALISA TANAH DAN BANGUNAN
|
-
-
+
+
+ @php
-
-
-
-
- |
- F
- |
-
- ANALISA TANAH DAN BANGUNAN
- |
-
-
-
-
@endif
-
- name, $forminspeksi['tanah']['kontur_tanah']) ? 'checked' : '' }}> {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Permukaan dengan Jalan |
@@ -577,15 +581,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Peruntukan Tanah |
@@ -597,15 +601,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Fisik Tanah |
@@ -617,15 +621,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Jenis Bangunan |
@@ -637,15 +641,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Kondisi Bangunan |
@@ -657,15 +661,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
| Sifat Bangunan |
@@ -677,15 +681,15 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $item->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $item->name }}
|
- @endforeach
-
-
- @endif
-
@foreach ($basicData['spekKategoriBangunan'] as $kategori)
@@ -698,72 +702,72 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ |
+ {{ $sifat->name }}
+ |
+ @endforeach
+
+
@endif
-
- {{ $sifat->name }}
|
+
@endforeach
-
-
- @endif
-
-
- @endforeach
-
+
-
+
-
-
-
-
- |
- G
- |
-
- SARANA PELENGKAP DAN LINGKUNGAN
- |
-
-
-
-
+
+
+
- @php
+ |
+ G
+ |
+
+ SARANA PELENGKAP DAN LINGKUNGAN
+ |
+
+
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -795,13 +799,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -814,13 +818,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -833,13 +837,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -852,13 +856,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -871,13 +875,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -890,13 +894,13 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
-
-
- @endif
-
+
@@ -909,114 +913,113 @@
@if ($index % 3 == 0 && $index > 0)
+ @endif
+ | {{ $item->name }} |
+ @endforeach
+
+
@endif
-
{{ $item->name }} |
- @endforeach
+
-
- @endif
-
-
-
+
-
-
+
-
-
-
-
- |
- H
- |
-
- ASURANSI
- |
-
-
-
-
+
+
+
-
-
-
-
- |
- I
- |
-
- KESIMPULAN DAN SARAN PENILAI, INFORMASI HARGA,
- TOTAL NILAI JAMINAN DAN CATATAN PERLU DIPERHATIKAN
- |
-
-
-
-
+
+
+
+
+
+
+ |
+ I
+ |
+
+ KESIMPULAN DAN SARAN PENILAI, INFORMASI HARGA,
+ TOTAL NILAI JAMINAN DAN CATATAN PERLU DIPERHATIKAN
+ |
+
+
+
+
| 1. Kesimpulan dan saran penilai: |
-
- | Faktor Positif |
-
- @isset($forminspeksi['fakta']['fakta_positif'])
-
- @foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
-
- | [{{ $key }}] {{ $item }} |
-
- @endforeach
-
- @endisset
- |
-
-
-
- | Faktor Negatif |
-
- @isset($forminspeksi['fakta']['fakta_negatif'])
-
- @foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
-
- | [{{ $key }}] {{ $item }} |
-
- @endforeach
-
- @endisset
- |
-
-
- | Lain - lain : |
-
- - Berdasarkan hasil kunjungan di lapangan dapat disampaikan sebagai berikut :
-
- @isset($forminspeksi['fakta'])
- @foreach ($forminspeksi['fakta'] as $key => $item)
- @if (
- !in_array($key, [
- 'fakta_positif',
- 'fakta_negatif',
- 'rute_menuju',
- 'batas_batas',
- 'batas_batas_input',
- 'kondisi_lingkungan',
- 'kondisi_lain_bangunan',
- 'informasi_dokument',
- ]))
- {{ $item }}
- @endif
+ |
+ | Faktor Positif |
+
+ @isset($forminspeksi['fakta']['fakta_positif'])
+
+ @foreach ($forminspeksi['fakta']['fakta_positif'] as $key => $item)
+
+ | [{{ $key }}] {{ $item }} |
+
@endforeach
- @endisset
-
-
+
+ @endisset
+ |
+
+
+
+ | Faktor Negatif |
+
+ @isset($forminspeksi['fakta']['fakta_negatif'])
+
+ @foreach ($forminspeksi['fakta']['fakta_negatif'] as $key => $item)
+
+ | [{{ $key }}] {{ $item }} |
+
+ @endforeach
+
+ @endisset
+ |
+
+
+ | Lain - lain : |
+
+ - Berdasarkan hasil kunjungan di lapangan dapat disampaikan sebagai berikut :
+
+ @isset($forminspeksi['fakta'])
+ @foreach ($forminspeksi['fakta'] as $key => $item)
+ @if (
+ !in_array($key, [
+ 'fakta_positif',
+ 'fakta_negatif',
+ 'rute_menuju',
+ 'batas_batas',
+ 'batas_batas_input',
+ 'kondisi_lingkungan',
+ 'kondisi_lain_bangunan',
+ 'informasi_dokument',
+ ]))
+ {{ $item }}
+ @endif
+ @endforeach
+ @endisset
+ |
+
| 2. Informasi Harga: |
@@ -1065,114 +1068,125 @@
-
+
+
+
+
+
+
+
+ PETA LOKASI
+
+ @php
+ $fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
+ @endphp
+
+ @if (isset($forminspeksi))
+ @forelse ($fotoTypes as $type)
+
+ @php
+ $imagePath = $forminspeksi[$type];
+ @endphp
-
-
-
-
- PETA LOKASI
-
-
- @php
- $fotoTypes = ['foto_gistaru', 'foto_bhumi', 'foto_argis_region', 'foto_tempat'];
- @endphp
-
- @if (isset($forminspeksi))
- @forelse ($fotoTypes as $type)
-
- @php
- $imagePath = $forminspeksi[$type];
- @endphp
-
+ @if($imagePath && file_exists(storage_path('app/public/'. $imagePath)))
 }})
-
{{ Str::title(str_replace('_', ' ', $type)) }}
+ class="photo-image">
+ @endif
+
{{ Str::title(str_replace('_', ' ', $type)) }}
-
- @empty
-
Tidak ada tipe foto yang tersedia
- @endforelse
- @endif
-
-
-
-
-
-
- FOTO JAMINAN
-
-
-
- @if (isset($formFoto))
- @foreach ($formFoto['rute_menuju_lokasi'] as $item)
-
-
- {{ $item['name_rute'] . ' ' . $loop->index + 1 }}
-
-
-
![{{ $item['foto_rute'] }}]({{ storage_path('app/public/' . $item['foto_rute']) }})
-
- @endforeach
- @endif
-
- @if (isset($formFoto['object_jaminan']))
- @foreach ($formFoto['object_jaminan'] as $item)
-
-
- {{ $item['name_objek'] }}
-
-
-
![{{ $item['foto_objek'] }}]({{ storage_path('app/public/' . $item['foto_objek']) }})
-
- @endforeach
- @endif
-
- @if (isset($formFoto['foto_basement']))
-
-
- Basement
-
-
-
- @endif
-
- @if (isset($formFoto['foto_gerbang']))
-
-
- Gerbang
-
-
-
![{{ $formFoto['foto_gerbang'] }}]({{ storage_path('app/public/' . $formFoto['foto_gerbang']) }})
-
- @endif
- @if (isset($formFoto['pendamping']))
-
-
- Pendamping
-
-
-
![{{ $formFoto['pendamping'] }}]({{ storage_path('app/public/' . $formFoto['pendamping']) }})
-
- @endif
-
+ @empty
+
Tidak ada tipe foto yang tersedia
+ @endforelse
+ @endif
-
+