diff --git a/app/Helpers/Lpj.php b/app/Helpers/Lpj.php index 83d30e9..727973b 100644 --- a/app/Helpers/Lpj.php +++ b/app/Helpers/Lpj.php @@ -293,7 +293,23 @@ function holidays() function countPermohonanForUser($userId) { - $validStatuses = ['assign', 'proses-laporan', 'done']; + $validStatuses = [ + 'assign', + 'survey-completed', + 'proses-laporan', + 'paparan', + 'proses-paparan', + 'revisi-laporan', + 'revisi-paparan', + 'survey', + 'proses-survey', + 'request-reschedule', + 'reschedule', + 'rejected-reschedule', + 'approved-reschedule', + 'revisi-survey', + 'revisi-pembayaran' + ]; $result = Penilaian::whereHas('userPenilai', function ($query) use ($userId) { $query->where('user_id', $userId); @@ -412,3 +428,22 @@ function getWilayahName($code, $type) return null; } } + + +function formatLabel($key) { + + $customLabels = [ + 'shgb_no_kel_desa' => 'SHGB', + 'nib' => 'NIB', + 'img_pbg_no' =>'IMB/PBG NO', + 'no_surat_ukur_gs' => 'No Surat Ukur/GS', + ]; + + // Jika ada dalam mapping, gunakan label custom + if (array_key_exists($key, $customLabels)) { + return $customLabels[$key]; + } + + // Default: Ubah underscore menjadi spasi dan kapitalisasi + return ucwords(str_replace('_', ' ', $key)); +} diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 22105b6..8670fe3 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -392,7 +392,23 @@ class ActivityController extends Controller $q->where('user_id', $id); }) ->whereHas('permohonan', function ($q) { - $q->whereNotIn('status', ['done']); + $q->whereIn('status', [ + 'assign', + 'survey-completed', + 'proses-laporan', + 'paparan', + 'proses-paparan', + 'revisi-laporan', + 'revisi-paparan', + 'survey', + 'proses-survey', + 'request-reschedule', + 'reschedule', + 'rejected-reschedule', + 'approved-reschedule', + 'revisi-survey', + 'revisi-pembayaran' + ]); }); diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index e9722f9..819a1d6 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -754,9 +754,13 @@ class PenilaiController extends Controller if (!$allComplete) { + $message = $rap + ? 'Harap Mengisi laporan terlebih dahulu' + : 'Harap Mengisi laporan terlebih dahulu atau kertas kerja'; + return response()->json([ 'success' => false, - 'message' => 'Harap Mengisi laporan terlebih dahulu atau kertas kerja', + 'message' => $message, ], 400); } diff --git a/app/Http/Controllers/SurveyorController.php b/app/Http/Controllers/SurveyorController.php index 4f254df..6d5bc2d 100644 --- a/app/Http/Controllers/SurveyorController.php +++ b/app/Http/Controllers/SurveyorController.php @@ -962,7 +962,8 @@ class SurveyorController extends Controller $validate = $request->validate([ 'id' => 'required', 'waktu_penilaian' => 'required', - 'deskripsi_penilaian' => 'required' + 'deskripsi_penilaian' => 'required', + 'keterangan' => 'required', ]); $penilaian = Penilaian::findOrFail($id); @@ -3713,7 +3714,7 @@ class SurveyorController extends Controller return response()->json([ 'status' => 'success', - 'message' => 'Reschedule jadwal dengan nomor registrasi ' . $validatedData['nomor_registrasi'] . ' berhasil ditolak dengan alasan: ' . $validatedData['rejected_note'], + 'message' => 'Reschedule jadwal dengan nomor registrasi ' . $validatedData['nomor_registrasi'] . ' berhasil dengan alasan: ' . $validatedData['rejected_note'], ]); } catch (\Exception $e) { // Rollback jika ada error diff --git a/resources/views/penilai/components/foto-jaminan.blade.php b/resources/views/penilai/components/foto-jaminan.blade.php index 49a26a0..a92fc18 100644 --- a/resources/views/penilai/components/foto-jaminan.blade.php +++ b/resources/views/penilai/components/foto-jaminan.blade.php @@ -46,36 +46,24 @@ /* Media Print */ @media print { - .photo-item { - width: 48%; - margin-right: 2%; - float: left; - padding: 5px; - box-sizing: border-box; - page-break-inside: avoid; - } - - .photo-item img { - width: 300px; - height: 300px; - object-fit: contain; - background-color: #f0f0f0; - border-radius: 5px; - page-break-inside: avoid; - } - - h2 { - font-size: 14px; - } - - .photo-container { - page-break-inside: avoid; - } - - .photo-row { - page-break-inside: avoid; - } - } + table { + width: 100%; + border-collapse: collapse; + } + td { + vertical-align: top; + text-align: center; + page-break-inside: avoid; + } + .photo-image { + width: auto; + height: 400px; + max-height: 400px; + } + .page-break { + page-break-after: always; + } + } @isset($basicData['foto']) @@ -93,6 +81,8 @@ @if ($groupedPhotos->isEmpty())

Tidak ada foto yang tersedia.

@else + + @foreach ($mainPhotos as $category => $photos) @php $groupedBySubcategory = $photos->groupBy('sub'); @@ -100,142 +90,77 @@ @foreach ($groupedBySubcategory as $subcategory => $subPhotos) @if (count($subPhotos) > 0) - - - @if (count($subPhotos) === 1) - @php - $item = $subPhotos->first(); - $imagePath = storage_path('app/public/' . $item['path']); - @endphp - - @else - @foreach ($subPhotos as $index => $item) + @foreach ($subPhotos->chunk(2) as $chunkedPhotos) +
-

{{ $category }} - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} -

- @if ($statusLpj || file_exists($imagePath)) - {{ $item['path'] }} - @endif - @isset($item['description']) -

{{ $item['description'] }}

- @endisset -
+ @foreach ($chunkedPhotos as $item) @php $imagePath = storage_path('app/public/' . $item['path']); @endphp - + - @if (($index + 1) % 2 == 0) - - + + @endforeach + @if (count($chunkedPhotos) < 2) + + @endif +
+

{{ $category }} - - @isset($subcategory) @if (trim($subcategory) !== '') {{ $subcategory }} - @endif @endisset - {{ $item['name'] ?? '' }}

@if ($statusLpj || file_exists($imagePath)) - {{ $item['path'] }} + {{ $item['path'] }} @endif @isset($item['description'])

{{ $item['description'] }}

@endisset
+
+ @endforeach @endif @endforeach - @if (count($subPhotos) % 2 != 0) - - @endif - @endif - - - @endif - @endforeach - @endforeach - @endif - -
- - @if (!$otherPhotos->isEmpty()) - @foreach ($otherPhotos->groupBy('sub') as $subcategory => $subPhotos) - @if (count($subPhotos) > 0) - - - @if (count($subPhotos) === 1) - @php - $item = $subPhotos->first(); - $imagePath = storage_path('app/public/' . $item['path']); - @endphp - - @else - @foreach ($subPhotos as $index => $item) - @php - $imagePath = storage_path('app/public/' . $item['path']); - @endphp - - @if (($index + 1) % 2 == 0) - - - @endif @endforeach - @if (count($subPhotos) % 2 != 0) - + + @if (!$otherPhotos->isEmpty()) + @foreach ($otherPhotos->groupBy('sub') as $subcategory => $subPhotos) + @if (count($subPhotos) > 0) + @foreach ($subPhotos->chunk(2) as $chunkedPhotos) +
-

Lainnya - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} -

- @if ($statusLpj || file_exists($imagePath)) - {{ $item['path'] }} - @endif - @isset($item['description']) -

{{ $item['description'] }}

- @endisset -
-

Lainnya - - - @isset($subcategory) - @if (trim($subcategory) !== '') - {{ $subcategory }} - - @endif - @endisset - - {{ $item['name'] ?? '' }} -

- @if ($statusLpj || file_exists($imagePath)) - {{ $item['path'] }} - @endif - @isset($item['description']) -

{{ $item['description'] }}

- @endisset -
+ @foreach ($chunkedPhotos as $item) + @php + $imagePath = storage_path('app/public/' . $item['path']); + @endphp + + + @endforeach + + @if (count($chunkedPhotos) < 2) + + @endif +
+

Lainnya - + @isset($subcategory) + @if (trim($subcategory) !== '') + {{ $subcategory }} - + @endif + @endisset + {{ $item['name'] ?? '' }} +

+ @if ($statusLpj || file_exists($imagePath)) + {{ $item['path'] }} + @endif + @isset($item['description']) +

{{ $item['description'] }}

+ @endisset +
+ @endforeach + @endif + @endforeach @endif @endif - - - @endif - @endforeach - @endif @endisset + diff --git a/resources/views/penilaian/otorisator/show.blade.php b/resources/views/penilaian/otorisator/show.blade.php index 28d55d5..a09a60a 100644 --- a/resources/views/penilaian/otorisator/show.blade.php +++ b/resources/views/penilaian/otorisator/show.blade.php @@ -216,24 +216,24 @@ - @if (Auth::user()->hasAnyRole(['administrator', 'senior-officer']) && $authorization->approve_so == null) - @endif - @if (Auth::user()->hasAnyRole(['administrator', 'EO Appraisal']) && $authorization->approve_eo == null) - @endif - @if (Auth::user()->hasAnyRole(['administrator', 'DD Appraisal']) && $authorization->approve_dd == null) -