diff --git a/app/Http/Controllers/PenilaiController.php b/app/Http/Controllers/PenilaiController.php index c21a125..0c42578 100644 --- a/app/Http/Controllers/PenilaiController.php +++ b/app/Http/Controllers/PenilaiController.php @@ -18,6 +18,7 @@ use Modules\Location\Models\City; use Modules\Location\Models\District; use Modules\Location\Models\Village; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\App; use App\Helpers\Lpj; class PenilaiController extends Controller @@ -649,7 +650,7 @@ class PenilaiController extends Controller try { if ($statusLpj) { - return view('lpj::' . $viewLaporan, compact( + return view('lpj::' . $viewLaporan, compact( 'permohonan', 'forminspeksi', 'lpjData', @@ -661,7 +662,8 @@ class PenilaiController extends Controller 'alamat', 'dataPembanding', 'nomorLaporan' - )); + ))->render(); + } else { $pdf = PDF::loadView('lpj::' . $viewLaporan, compact( 'permohonan', diff --git a/app/Http/Controllers/PenilaianController.php b/app/Http/Controllers/PenilaianController.php index 1599ac8..e7d33be 100644 --- a/app/Http/Controllers/PenilaianController.php +++ b/app/Http/Controllers/PenilaianController.php @@ -557,5 +557,12 @@ ]); } + public function view_laporan(Request $request){ + + $id = $request->permohonanId; + + $permohonan = Permohonan::find($id); + return view('lpj::penilaian.laporan-so', compact('permohonan')); + } } diff --git a/resources/views/activity/progres_activity/index.blade.php b/resources/views/activity/progres_activity/index.blade.php index 116c354..af59311 100644 --- a/resources/views/activity/progres_activity/index.blade.php +++ b/resources/views/activity/progres_activity/index.blade.php @@ -209,9 +209,9 @@ due_date: { title: 'Due Date', render: (item, data) => { - const mulai = new Date(data.permohonan.created_at); - const selesai = new Date(data.tanggal_kunjungan) - return `${mulai.getDate()}-${mulai.getMonth() + 1}-${mulai.getFullYear()} - ${selesai.getDate()}-${selesai.getMonth() + 1}-${selesai.getFullYear()}` + const jenis_asset = data.permohonan.debiture.documents.map(d => d.jenis_jaminan.name ); + + return `${calculateDateSLA(jenis_asset, data.tanggal_kunjungan)}`; }, }, @@ -254,6 +254,12 @@ const year = String(date.getFullYear()).slice(-2); return `${day}-${month}-${year}`; } + + + function calculateDateSLA($jenis, $date){ + let date = new Date($date); + return $jenis, $date; + } @endpush diff --git a/resources/views/penilaian/laporan-so.blade.php b/resources/views/penilaian/laporan-so.blade.php new file mode 100644 index 0000000..b952403 --- /dev/null +++ b/resources/views/penilaian/laporan-so.blade.php @@ -0,0 +1,93 @@ +@extends('layouts.main') + +@section('content') + +
+
+

+ Laporan +

+ + Back + +
+
+ +
+
+

Loading...

+
+ + + +
+
+ +@endsection + +@php +$inspeksiId = null; +$documentId = null; +$jenisJaminanId = null; + +foreach ($permohonan->debiture->documents as $item) { + if (!empty($item->inspeksi)) { + $inspeksiId = $item->inspeksi[0]->id; // Asumsi mengambil inspeksi pertama + } + $documentId = $item->id; + $jenisJaminanId = $item->jenis_jaminan_id; +} +@endphp + + + + diff --git a/resources/views/penilaian/otorisator/show.blade.php b/resources/views/penilaian/otorisator/show.blade.php index b129da9..4fe235b 100644 --- a/resources/views/penilaian/otorisator/show.blade.php +++ b/resources/views/penilaian/otorisator/show.blade.php @@ -64,7 +64,7 @@ @if ($dataHeader == 'pelaporan') + href="{{ route('otorisator.view-laporan') }}?permohonanId={{ $permohonan->id }}&documentId={{ $documentId }}&inspeksiId={{ $inspeksiId }}&jaminanId={{ $jenisJaminanId }}&statusLpj={{true}}"> Lihat Laporan @endif diff --git a/resources/views/surveyor/components/foto.blade.php b/resources/views/surveyor/components/foto.blade.php index 436180d..eb92a0a 100644 --- a/resources/views/surveyor/components/foto.blade.php +++ b/resources/views/surveyor/components/foto.blade.php @@ -398,10 +398,10 @@
@foreach ($lantaiFotos as $foto)
- {{ $foto['name'] }} -
@endforeach
-