diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index b3c498f..3f21f73 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -82,7 +82,7 @@ class PenilaiController extends Controller public function sederhana(Request $request, $id) { - $documentId = $request->query('documentId'); + $documentId = $request->query('dokument'); $jaminanId = $request->query('jaminanId'); $permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId); $basicData = $this->surveyorController->getCommonData(); @@ -148,10 +148,15 @@ class PenilaiController extends Controller public function standar(Request $request, $id) { - $documentId = $request->query('documentId'); + $documentId = $request->query('dokument'); $jaminanId = $request->query('jaminanId'); $permohonan = $this->surveyorController->getPermohonanJaminanId($id, $documentId, $jaminanId); + + if ($permohonan->status == 'proses-laporan') { + return redirect()->back()->with('error', 'Masih dalam proses laporan'); + } + $basicData = $this->surveyorController->getCommonData(); $noLpSederhana = $this->generateNoLaporan($permohonan, $documentId, 'lpj'); @@ -218,6 +223,11 @@ class PenilaiController extends Controller $jaminanId = $request->query('jaminanId'); $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); + + if ($permohonan->status == 'proses-laporan') { + return redirect()->back()->with('error', 'Masih dalam proses laporan'); + } + $nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'resume'); $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); $noLpresume = $this->generateNoLaporan($permohonan, $documentId, 'resume'); @@ -253,6 +263,9 @@ class PenilaiController extends Controller $data = $this->getDataPermohonanWithPenilaiAndInspeksi($req['permohonanId'], $req['documentId'], $req['jaminanId']); $permohonan = $data['permohonan']; + if ($permohonan->status == 'proses-laporan') { + return redirect()->back()->with('error', 'Masih dalam proses laporan'); + } $nomorLaporan = $this->generateNoLaporan($permohonan, $req['documentId'], 'memo'); $inspeksi = Inspeksi::where('permohonan_id', $req['permohonanId'])->where('dokument_id', $req['documentId'])->first(); @@ -388,10 +401,15 @@ class PenilaiController extends Controller { $permohonanId = $request->query('permohonanId'); - $documentId = $request->query('documentId'); + $documentId = $request->query('dokument'); $jaminanId = $request->query('jaminanId'); $provinces = Province::all(); $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); + + if ($permohonan->status == 'proses-laporan') { + return redirect()->back()->with('error', 'Masih dalam proses laporan'); + } + $nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'rap'); $basicData = $this->surveyorController->getCommonData(); $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); @@ -470,6 +488,9 @@ class PenilaiController extends Controller $jaminanId = $request->query('jaminanId'); $provinces = Province::all(); $permohonan = $this->surveyorController->getPermohonanJaminanId($permohonanId, $documentId, $jaminanId); + if ($permohonan->status == 'proses-laporan') { + return redirect()->back()->with('error', 'Masih dalam proses laporan'); + } $nomorLaporan = $this->generateNoLaporan($permohonan, $documentId, 'call-report'); $basicData = $this->surveyorController->getCommonData(); $inspeksi = Inspeksi::where('permohonan_id', $permohonanId)->where('dokument_id', $documentId)->first(); diff --git a/resources/views/component/form-penilai.blade.php b/resources/views/component/form-penilai.blade.php index 12b2cee..946ca13 100644 --- a/resources/views/component/form-penilai.blade.php +++ b/resources/views/component/form-penilai.blade.php @@ -36,7 +36,7 @@ Informasi dan pembanding
- Edit Data Pembanding @@ -553,7 +553,7 @@ const urlParams = new URLSearchParams(window.location.search); const permohonanId = {{ $permohonan->id }}; - const documentId = urlParams.get('documentId'); + const documentId = urlParams.get('dokument'); const inspeksiId = urlParams.get('inspeksiId'); const requestUrl = diff --git a/resources/views/penilai/components/lpj-sederhana-standar.blade.php b/resources/views/penilai/components/lpj-sederhana-standar.blade.php index 1008b5f..e210da6 100644 --- a/resources/views/penilai/components/lpj-sederhana-standar.blade.php +++ b/resources/views/penilai/components/lpj-sederhana-standar.blade.php @@ -23,7 +23,7 @@ @include('lpj::assetsku.includenya')
- + @include('lpj::component.form-penilai') @@ -52,15 +52,15 @@ @endif @if (Auth::user()->hasAnyRole(['senior-officer', 'EO Appraisal', 'DD Appraisal', 'administrator'])) + href="{{ route('penilai.lampiran') }}?permohonanId={{ $permohonan->id }}&documentId={{ request('dokument') }}&jaminanId={{ request('jaminanId') }}&statusLpj=1"> Lampiran Foto dan Dokumen - Cetak Hasil Inspeksi + onclick="checkLaporan('{{ $permohonan->id }}', '{{ request('dokument') }}', {{ request('jaminanId') }}, 0)"> Cetak Laporan @endif diff --git a/resources/views/penilai/show.blade.php b/resources/views/penilai/show.blade.php index 853834f..705c3cb 100644 --- a/resources/views/penilai/show.blade.php +++ b/resources/views/penilai/show.blade.php @@ -493,11 +493,11 @@ if (data.status === 'standar') { showLoadingSwal('Tunggu ...'); window.location.href = - `{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`; + `{{ route('penilai.standar', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`; } else if (data.status === 'sederhana') { showLoadingSwal('Tunggu ...'); window.location.href = - `{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`; + `{{ route('penilai.sederhana', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`; } } else { if (fasilitasKredit.toUpperCase() === 'KPR KERJASAMA') { @@ -556,10 +556,10 @@ if (data.success) { if (type === 'standar') { window.location.href = - `{{ route('penilai.standar', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`; + `{{ route('penilai.standar', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`; } else if (type === 'sederhana') { window.location.href = - `{{ route('penilai.sederhana', $permohonan->id) }}?documentId=${documentId}&jaminanId=${jaminanId}`; + `{{ route('penilai.sederhana', $permohonan->id) }}?dokument=${documentId}&jaminanId=${jaminanId}`; } } }); @@ -640,7 +640,7 @@ function rap(permohonanId, documentId, jaminanId) { showLoadingSwal('Tunggu ...'); window.location.href = - `{{ route('penilai.rap') }}?permohonanId=${permohonanId}&documentId=${documentId}&jaminanId=${jaminanId}`; + `{{ route('penilai.rap') }}?permohonanId=${permohonanId}&dokument=${documentId}&jaminanId=${jaminanId}`; }