@extends('layouts.app') @section('title', 'Detail Permohonan — ' . $application->applicant_name) @section('content')
{{-- ── Header ── --}}
{{ $application->applicant_name }}
{{ $application->id }}
{!! $application->status_badge !!}
{{-- ── Flash Messages ── --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- ── Progress Tracker ── --}} @php // Alur baru: Tahap 3 → Tahap 5 (FA) → [Tahap 4 (DA) + Tahap 6 (Finalisasi) bersamaan] → Tahap 7 $stages = [ 'submitted' => ['label' => 'Diajukan', 'icon' => 'send', 'step' => 1], 'fa_pending' => ['label' => 'Field Analysis', 'icon' => 'geo-alt', 'step' => 2], 'fa_inprogress' => ['label' => 'FA Berjalan', 'icon' => 'geo-alt', 'step' => 2], 'fa_submitted' => ['label' => 'FA Selesai', 'icon' => 'geo-alt-fill', 'step' => 2], 'da_review' => ['label' => 'DA + Finalisasi', 'icon' => 'clipboard-check', 'step' => 3], 'verifikasi_final' => ['label' => 'DA + Finalisasi', 'icon' => 'stars', 'step' => 3], 'signature' => ['label' => 'Keputusan', 'icon' => 'pen', 'step' => 4], 'disetujui' => ['label' => 'Disetujui', 'icon' => 'check-circle', 'step' => 5], 'bersyarat' => ['label' => 'Bersyarat', 'icon' => 'exclamation-circle','step' => 5], 'ditolak' => ['label' => 'Ditolak', 'icon' => 'x-circle', 'step' => 5], ]; $statusValue = $application->status instanceof \App\Core\Enums\ApplicationStatus ? $application->status->value : $application->status; $currentStep = $stages[$statusValue]["step"] ?? 0; $stageList = [ ['step' => 1, 'label' => 'Pengajuan'], ['step' => 2, 'label' => 'Field Analysis'], ['step' => 3, 'label' => 'DA + Finalisasi'], ['step' => 4, 'label' => 'Keputusan'], ['step' => 5, 'label' => 'Hasil'], ]; @endphp @if($statusValue !== 'draft')
@foreach($stageList as $s) @php $done = $currentStep > $s['step']; $active = $currentStep === $s['step']; $color = $done ? '#198754' : ($active ? 'var(--bpdlh-green)' : '#adb5bd'); $bgColor = $done ? '#198754' : ($active ? 'var(--bpdlh-green)' : '#e9ecef'); @endphp
@if($done) @else {{ $s['step'] }} @endif
{{ $s['label'] }}
@endforeach
@endif {{-- ── Action Banners per Status ── --}} {{-- Tahap 4 (DA) — dilaksanakan SETELAH FA, bersamaan dengan Tahap 6 --}} @if(in_array($statusValue, ['fa_submitted', 'verifikasi_final']) && auth()->user()->hasAnyRole(['financial_staff', 'supervisor']))
Tahap 4 — Desk Analysis Post-FA
FA selesai. Lakukan review dokumen, input SLIK, dan evaluasi compliance parameter (bersamaan dengan Finalisasi).
Buka Desk Analysis
@endif {{-- Tahap 5: FA — dilaksanakan LANGSUNG setelah submit Tahap 3 --}} @if(in_array($statusValue, ['fa_pending', 'fa_inprogress'])) @if(auth()->user()->hasAnyRole(['field_officer', 'financial_staff', 'supervisor']) || $application->submitted_by === auth()->id())
Field Analysis
Pengajuan diajukan. PL turun lapangan untuk verifikasi fisik kondisi lahan dan tanaman. @if($application->catatan_da)
Catatan dari Verifikasi: {{ Str::limit($application->catatan_da, 120) }} @endif
Buka Field Analysis
@endif @endif {{-- Tahap 6: Finalisasi (bersamaan dengan Tahap 4 DA) --}} @if(in_array($statusValue, ['fa_submitted', 'verifikasi_final']) && auth()->user()->hasAnyRole(['financial_staff', 'supervisor']))
Tahap 6 — Finalisasi Verifikasi + CSL
FA dari PL sudah masuk. Review, hitung CSL, dan submit ke Signature. @if($application->cslScoring)
{!! $application->cslScoring->kategori_risiko_badge !!} Skor: {{ number_format($application->cslScoring->skor_total, 1) }} | {{ $application->cslScoring->status_layak ? 'Layak' : 'Tidak Layak' }}
@endif
Buka Finalisasi
@endif {{-- Tahap 7: Signature --}} @if($statusValue === 'signature') @if(auth()->user()->hasAnyRole(['signature', 'supervisor']))
Tahap 7 — Keputusan Signature
Pengajuan siap untuk diputuskan. Review ringkasan dan berikan keputusan final.
Berikan Keputusan
@else
Menunggu Keputusan Signature/Komite. Pengajuan sudah dikirim ke Komite dan menunggu keputusan final.
@endif @endif {{-- Hasil Keputusan Signature --}} @if(in_array($statusValue, ['disetujui', 'bersyarat', 'ditolak']) && $application->keputusanKredit) @php $kk = $application->keputusanKredit; @endphp
Keputusan Signature: {!! $kk->keputusan_badge !!} oleh {{ $kk->signatureUser?->name ?? '-' }} pada {{ $kk->tanggal_keputusan->format('d M Y H:i') }} @if($kk->plafond_final)
Plafond Final: Rp {{ number_format($kk->plafond_final, 0, ',', '.') }} | Tenor: {{ $kk->tenor_final }} bulan | Skema: {{ \App\Models\KeputusanKredit::$SKEMA_OPTIONS[$kk->skema_angsuran] ?? $kk->skema_angsuran }}
@endif @if($kk->kondisi_bersyarat)
Kondisi: {{ $kk->kondisi_bersyarat }}
@endif @if($kk->alasan)
Alasan: {{ $kk->alasan }}
@endif
Detail
@endif {{-- ══════════════════════════════════════════════════════════════════════ --}} {{-- Detail Tabs --}} {{-- ══════════════════════════════════════════════════════════════════════ --}}
{{-- ═══════════════════════════════════ --}} {{-- TAB 1: INFO KREDIT --}} {{-- ═══════════════════════════════════ --}}
@include('applications.partials.detail-table', ['rows' => [ 'Jenis Layanan' => $application->jenis_layanan ? ucwords(str_replace('_', ' ', $application->jenis_layanan)) : '-', 'Status Pinjaman' => $application->status_pinjaman ? ucfirst($application->status_pinjaman) : '-', 'Komoditas Utama' => $application->komoditasUtama?->nama ?? '-', 'Tipe Usaha' => $application->tipe_usaha ? ucfirst($application->tipe_usaha) : '-', 'Tujuan Pembiayaan' => $application->tujuan_pembiayaan_kategori ? ucwords(str_replace('_', ' ', $application->tujuan_pembiayaan_kategori)) : ($application->tujuan_pembiayaan ?? '-'), ]])
@php $paketMap = ['paket1'=>'Paket 1 — Rp 5 jt','paket2'=>'Paket 2 — Rp 7 jt','paket3'=>'Paket 3 — Rp 10 jt','lainnya'=>'Lainnya']; $skemaMap = \App\Models\KeputusanKredit::$SKEMA_OPTIONS; @endphp @include('applications.partials.detail-table', ['rows' => [ 'Paket Fasilitas' => $paketMap[$application->paket_fasilitas] ?? '-', 'Plafond Diajukan' => $application->plafond_diajukan ? 'Rp ' . number_format($application->plafond_diajukan, 0, ',', '.') : '-', 'Plafond Rekomendasi RPC'=> $application->plafond_rekomendasi_rpc ? 'Rp ' . number_format($application->plafond_rekomendasi_rpc, 0, ',', '.') : '-', 'Plafond Disetujui' => $application->plafond_disetujui ? 'Rp ' . number_format($application->plafond_disetujui, 0, ',', '.') : '-', 'Tenor' => $application->tenor_bulan ? $application->tenor_bulan . ' bulan' : '-', 'Skema Angsuran' => $skemaMap[$application->skema_angsuran] ?? ($application->skema_angsuran ?? '-'), ]])
{{-- SLA & Timeline --}} @if($application->sla_deadline)
@include('applications.partials.detail-table', ['rows' => [ 'Tanggal Submit' => $application->tanggal_submit?->format('d M Y H:i') ?? '-', 'SLA Deadline' => $application->sla_deadline?->format('d M Y') ?? '-', 'Diajukan oleh' => $application->submittedBy?->name ?? '-', ]])
@endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 2: DATA PEMOHON --}} {{-- ═══════════════════════════════════ --}}
@php $deb = $application->debitur; @endphp @if(!$deb)
Data debitur belum tersedia.
@else
@include('applications.partials.detail-table', ['rows' => [ 'Nama Lengkap' => $deb->nama ?? '-', 'Jenis Kelamin' => match($deb->jenis_kelamin ?? '') { 'L' => 'Laki-laki', 'P' => 'Perempuan', default => '-' }, 'NIK' => $deb->nik ?? '-', 'No. Kartu Keluarga'=> $deb->no_kk ?? '-', 'Tempat Lahir' => $deb->tempat_lahir ?? '-', 'Tanggal Lahir' => $deb->ttl ? $deb->ttl->format('d M Y') . ' (' . $deb->umur . ' tahun)' : '-', 'Pendidikan' => $deb->pendidikan ? ucfirst($deb->pendidikan) : '-', 'Status Perkawinan' => $deb->status_kawin ? ucwords(str_replace('_', ' ', $deb->status_kawin)) : '-', 'Nama Ibu Kandung' => $deb->nama_ibu ?? '-', 'Jumlah Tanggungan' => isset($deb->tanggungan) ? $deb->tanggungan . ' orang' : '-', ]]) @if(in_array($deb->status_kawin ?? '', ['kawin'])) @include('applications.partials.detail-table', ['rows' => [ 'Nama Pasangan' => $deb->nama_pasangan ?? '-', 'NIK Pasangan' => $deb->nik_pasangan ?? '-', 'Tempat Lahir' => $deb->tempat_lahir_pasangan ?? '-', 'Tanggal Lahir' => $deb->ttl_pasangan ? $deb->ttl_pasangan->format('d M Y') : '-', ]]) @endif
@include('applications.partials.detail-table', ['rows' => [ 'Alamat' => $deb->alamat ?? '-', 'Dusun' => $deb->dusun ?? '-', 'RT/RW' => $deb->rt_rw ?? '-', 'Kelurahan/Desa' => $deb->kelurahan ?? '-', 'Kecamatan' => $deb->kecamatan ?? '-', 'Kabupaten/Kota' => $deb->kabupaten ?? '-', 'Provinsi' => $deb->provinsi ?? '-', 'No. HP' => $deb->no_hp ?? '-', 'Status Tempat Tinggal' => $deb->status_tempat_tinggal ? ucwords(str_replace('_', ' ', $deb->status_tempat_tinggal)) : '-', 'Lama Menempati' => $deb->lama_menempati_tahun ? $deb->lama_menempati_tahun . ' tahun' : '-', ]]) @if($deb->alamat_ktp_berbeda) @include('applications.partials.detail-table', ['rows' => [ 'Alamat KTP' => $deb->alamat_ktp ?? '-', 'RT/RW KTP' => $deb->rt_rw_ktp ?? '-', 'Kelurahan KTP' => $deb->kelurahan_ktp ?? '-', 'Kecamatan KTP' => $deb->kecamatan_ktp ?? '-', 'Kabupaten KTP' => $deb->kabupaten_ktp ?? '-', 'Provinsi KTP' => $deb->provinsi_ktp ?? '-', 'No. Telp KTP' => $deb->no_telp_ktp ?? '-', 'Status Tempat Tinggal' => $deb->status_tt_ktp ? ucwords(str_replace('_', ' ', $deb->status_tt_ktp)) : '-', ]]) @endif
@endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 3: KELOMPOK --}} {{-- ═══════════════════════════════════ --}}
@php $pk = $application->pengajuanKelompok; $klp = $pk?->kelompok ?? $application->kelompok; @endphp @if(!$klp)
Data kelompok belum tersedia.
@else
@include('applications.partials.detail-table', ['rows' => [ 'Nama KTH' => $klp->nama ?? '-', 'Desa' => $klp->desa ?? '-', 'Kecamatan' => $klp->kecamatan ?? '-', 'Kabupaten' => $klp->kabupaten ?? '-', 'Provinsi' => $klp->provinsi ?? '-', 'Tanggal Berdiri' => $klp->tanggal_berdiri ? $klp->tanggal_berdiri->format('d M Y') : '-', 'Legalitas' => $klp->legalitas ?? '-', 'Jumlah Anggota Total' => $klp->jumlah_anggota_total ? $klp->jumlah_anggota_total . ' orang' : '-', ]]) @if($klp->file_legalitas) @endif
{{-- Pengurus dari snapshot jika ada, fallback ke relasi live --}} @php $pengurusList = $pk?->pengurus_snapshot ?? $klp->pengurus?->toArray() ?? []; @endphp @if($pengurusList)
@foreach($pengurusList as $pengurus) @endforeach
{{ ucfirst($pengurus['jabatan'] ?? '') }} {{ $pengurus['nama'] ?? '-' }}
@endif @if($pk) @include('applications.partials.detail-table', ['rows' => [ 'Pendamping' => $pk->nama_pendamping ?? '-', 'Afiliasi Pendamping' => $pk->afiliasi_pendamping ?? '-', 'Anggota Mengajukan Ronde' => $pk->jumlah_anggota_mengajukan ? $pk->jumlah_anggota_mengajukan . ' orang' : '-', ]]) @if($pk->penilaian_kriteria)
@foreach($pk->penilaian_kriteria as $kr) @endforeach
Kriteria Status
{{ $kr['kriteria'] ?? '-' }} @if(($kr['status'] ?? '') === 'lulus') Lulus @else Tidak @endif
@endif @endif
@endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 4: USAHA & LAHAN --}} {{-- ═══════════════════════════════════ --}}
@php $deb = $application->debitur; @endphp
@include('applications.partials.detail-table', ['rows' => [ 'Tipe Pendapatan/Siklus' => $deb?->tipe_pendapatan ? ucwords(str_replace('_', ' ', $deb->tipe_pendapatan)) : '-', 'Sektor Ekonomi' => $deb?->sektor_ekonomi ? ucwords(str_replace('_', ' ', $deb->sektor_ekonomi)) : '-', 'Usaha yang Dibiayai' => $deb?->usaha_dibiayai ?? '-', 'Alamat Usaha' => $deb?->alamat_usaha ?? '-', 'Telepon Usaha' => $deb?->telp_usaha ?? '-', 'NPWP' => $deb?->npwp ?? '-', 'Lama Usaha' => $application->lama_usaha_tahun ? $application->lama_usaha_tahun . ' tahun' : '-', 'Kepemilikan Usaha' => $deb?->status_kepemilikan_usaha ? ucwords(str_replace('_', ' ', $deb->status_kepemilikan_usaha)) : '-', 'Status Tempat Usaha' => $deb?->status_tempat_usaha ? ucwords(str_replace('_', ' ', $deb->status_tempat_usaha)) : '-', ]])
@include('applications.partials.detail-table', ['rows' => [ 'Luas Lahan' => $application->luas_lahan_ha ? $application->luas_lahan_ha . ' Ha' : '-', 'Tahun Tanam' => $application->tahun_tanam ?? '-', 'Status Lahan' => $application->status_lahan ? ucwords(str_replace('_', ' ', $application->status_lahan)) : '-', ]]) {{-- Jenis Tanaman --}} @if($application->tanaman_buah || $application->jumlah_pohon_kakao || $application->tanaman_naungan || $application->tanaman_tunda_tebang) @if($application->jumlah_pohon_kakao)
Kakao
{{ $application->jumlah_pohon_kakao }} pohon
@endif @if($application->tanaman_buah)
Buah-buahan & Kopi
@foreach($application->tanaman_buah as $t) @endforeach
{{ $t['nama'] ?? '-' }} {{ $t['jumlah'] ?? 0 }} pohon
@endif @if($application->tanaman_naungan)
Pohon Naungan
@foreach($application->tanaman_naungan as $t) @endforeach
{{ $t['nama'] ?? '-' }} {{ $t['jumlah'] ?? 0 }} pohon
@endif @if($application->tanaman_tunda_tebang)
Tunda Tebang
@foreach($application->tanaman_tunda_tebang as $t) @endforeach
{{ $t['nama'] ?? '-' }} {{ $t['jumlah'] ?? 0 }} pohon
@endif @endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 5: TALLYSHEET --}} {{-- ═══════════════════════════════════ --}}
@if($application->tanaman->isEmpty())
Data tanaman & produksi belum diinput.
@else @php $bulanLabels = ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Agt','Sep','Okt','Nov','Des']; $totalNilaiJaminan = 0; @endphp @foreach($application->tanaman as $tanaman)
{{ $tanaman->jenis_tanaman ?? $tanaman->komoditas?->nama ?? 'Tanaman' }}
@if($tanaman->is_utama) Utama @endif
{{-- Info Lahan --}}
LUAS LAHAN
{{ $tanaman->luas_lahan_ha ?? '-' }} Ha
TAHUN TANAM
{{ $tanaman->tahun_tanam ?? '-' }}
SIKLUS
{{ $tanaman->siklus_bulan ?? '-' }} bln
PANEN/TAHUN
{{ $tanaman->panen_per_tahun ?? '-' }} kali
{{-- Produksi Bulanan --}} @if($tanaman->produksiBulanan->isNotEmpty())
@php $totalKgTahunan = 0; $totalRpTahunan = 0; @endphp @foreach($tanaman->produksiBulanan as $prod) @php $totalKgTahunan += $prod->jumlah_panen_kg ?? 0; $totalRpTahunan += $prod->total_harga ?? 0; @endphp @endforeach
Bulan Qty (kg) Harga/kg Total Kondisi
{{ $bulanLabels[($prod->bulan - 1)] ?? $prod->bulan }} {{ number_format($prod->jumlah_panen_kg, 0) }} {{ number_format($prod->harga_per_kg, 0, ',', '.') }} {{ number_format($prod->total_harga, 0, ',', '.') }} @php $kondisi = $prod->kondisi ?? 'sehat'; @endphp {{ ucfirst($kondisi) }}
Total Tahunan {{ number_format($totalKgTahunan, 0) }} kg Rp {{ number_format($totalRpTahunan, 0, ',', '.') }}
@endif {{-- Kelas Pohon & Jaminan --}} @if($tanaman->kelasPohon->isNotEmpty()) @php $nilaiJaminanTanaman = $tanaman->kelasPohon->sum('nilai_total'); $totalNilaiJaminan += $nilaiJaminanTanaman; @endphp
@foreach($tanaman->kelasPohon as $kp) @endforeach
Jenis Pohon Kelas Keliling Jumlah Harga/Pohon Nilai Total
{{ $kp->jenis_pohon }} {{ $kp->kelas_keliling }} cm {{ number_format($kp->jumlah_pohon) }} Rp {{ number_format($kp->harga_per_pohon, 0, ',', '.') }} Rp {{ number_format($kp->nilai_total, 0, ',', '.') }}
Subtotal Nilai Jaminan ({{ $tanaman->jenis_tanaman }}) Rp {{ number_format($nilaiJaminanTanaman, 0, ',', '.') }}
@endif
@if(!$loop->last)
@endif @endforeach {{-- Ringkasan Nilai Jaminan --}} @if($totalNilaiJaminan > 0) @php $plafond = $application->plafond_diajukan ?? 0; $rasioJaminan = $plafond > 0 ? round(($totalNilaiJaminan / $plafond) * 100) : 0; $jaminanOk = $rasioJaminan >= 125; @endphp
TOTAL NILAI JAMINAN
Rp {{ number_format($totalNilaiJaminan, 0, ',', '.') }}
PLAFOND DIAJUKAN
Rp {{ number_format($plafond, 0, ',', '.') }}
RASIO JAMINAN
{{ $rasioJaminan }}% @if($jaminanOk) @else @endif
Min. 125% {{ $jaminanOk ? '— Terpenuhi' : '— Belum Terpenuhi' }}
@endif @endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 6: BIAYA & PENDAPATAN --}} {{-- ═══════════════════════════════════ --}}
{{-- Baris 1: Blok A (kiri) & Blok B (kanan) --}}
{{-- Blok A: Biaya Usaha --}}
@if($application->biayaUsaha->isEmpty())

Belum ada data biaya usaha.

@else @php $biayaByKategori = $application->biayaUsaha->groupBy('section'); $totalBiayaUsaha = $application->biayaUsaha->sum('total'); @endphp @foreach(\App\Models\BiayaUsaha::$kategoriLabels as $key => $label) @if(isset($biayaByKategori[$key]))
{{ $label }}
@foreach($biayaByKategori[$key] as $b) @endforeach
Item Qty Sat. Harga Total
{{ $b->nama_item }} {{ $b->qty }} {{ $b->satuan }} {{ number_format($b->harga_per_satuan, 0, ',', '.') }} {{ number_format($b->total, 0, ',', '.') }}
@endif @endforeach
Total Biaya Usaha Rp {{ number_format($totalBiayaUsaha, 0, ',', '.') }}
@endif
{{-- Blok B: Biaya Hidup --}}
@if($application->biayaHidup->isEmpty())

Belum ada data biaya hidup.

@else @php $totalBiayaHidup = $application->biayaHidup->sum('nominal_per_bulan'); @endphp
@foreach($application->biayaHidup as $bh) @endforeach
Komponen Per Bulan Per Tahun
{{ \App\Models\BiayaHidup::$kategoriLabels[$bh->kategori] ?? ucwords(str_replace('_',' ',$bh->kategori)) }} Rp {{ number_format($bh->nominal_per_bulan, 0, ',', '.') }} Rp {{ number_format($bh->nominal_per_bulan * 12, 0, ',', '.') }}
Total Biaya Hidup Rp {{ number_format($totalBiayaHidup, 0, ',', '.') }} Rp {{ number_format($totalBiayaHidup * 12, 0, ',', '.') }}
@endif
{{-- Baris 2: Blok C & Ringkasan RPC --}} @if($application->pendapatanLain->isNotEmpty() || isset($rpcData) && $rpcData)
{{-- Blok C: Pendapatan Tanaman Lain --}} @if($application->pendapatanLain->isNotEmpty())
@php $totalPendLain = 0; @endphp @foreach($application->pendapatanLain as $pl) @php $totalPendLain += $pl->pendapatan_per_tahun; @endphp @endforeach
Jenis Usaha / Tanaman Pendapatan/Tahun
{{ $pl->jenis_usaha }} Rp {{ number_format($pl->pendapatan_per_tahun, 0, ',', '.') }}
Total Pendapatan Lain Rp {{ number_format($totalPendLain, 0, ',', '.') }}
@endif {{-- Ringkasan RPC --}} @if($rpcData) @php $plafondDiajukan = $application->plafond_diajukan ?? 0; $maksPlafond = $rpcData['maks_plafond'] ?? 0; $rpc = $rpcData['rpc'] ?? 0; $plafondMelebihi = $plafondDiajukan > $maksPlafond; $pendUsaha = $rpcData['pendapatan_usaha'] ?? 0; $pendLain = $rpcData['pendapatan_lain'] ?? 0; $biayaUsahaThn = $rpcData['biaya_usaha_tahunan'] ?? 0; $biayaHidupThn = $rpcData['biaya_hidup_tahunan'] ?? 0; $pengeluaranRutin = $rpcData['pengeluaran_rutin'] ?? 0; $jw = $rpcData['jw'] ?? 1; $ir = $rpcData['ir'] ?? 0; // Angsuran per tahun = Plafond × (ir/100 + 1/jw) $angsuranTahunan = $maksPlafond > 0 ? $plafondDiajukan * ($ir / 100 + 1 / $jw) : 0; @endphp
{{-- Kartu perhitungan bergaya ledger --}}
{{-- Pendapatan --}}
PENDAPATAN
Pendapatan Usaha Dibiayai
Dari Blok A Tallysheet (estimasi produksi × harga)
+ Rp {{ number_format($pendUsaha, 0, ',', '.') }}
Pendapatan Usaha Lain
Dari Blok C — tanaman / usaha di luar komoditas utama
+ Rp {{ number_format($pendLain, 0, ',', '.') }}
{{-- Pengeluaran --}}
PENGELUARAN
Biaya Usaha Tahunan
Dari Blok A — total biaya operasional kebun per tahun
− Rp {{ number_format($biayaUsahaThn, 0, ',', '.') }}
Biaya Hidup Tahunan
Dari Blok B — kebutuhan rumah tangga × 12 bulan
− Rp {{ number_format($biayaHidupThn, 0, ',', '.') }}
{{-- Subtotal pengeluaran rutin --}}
Pengeluaran Rutin
= Biaya Usaha + Biaya Hidup
Rp {{ number_format($pengeluaranRutin, 0, ',', '.') }}
{{-- Kalkulasi RPC --}}
PERHITUNGAN RPC
Pend. Usaha + Pend. Lain Rp {{ number_format($pendUsaha + $pendLain, 0, ',', '.') }}
− Pengeluaran Rutin − Rp {{ number_format($pengeluaranRutin, 0, ',', '.') }}
Surplus Bersih Rp {{ number_format(($pendUsaha + $pendLain) - $pengeluaranRutin, 0, ',', '.') }}
× 70% (Repayment Capacity) = Rp {{ number_format($rpc, 0, ',', '.') }}
{{-- Hasil akhir: RPC & Maks Plafond --}}
RPC / TAHUN
Rp {{ number_format($rpc, 0, ',', '.') }}
Kemampuan bayar per tahun
MAKS PLAFOND RPC
Rp {{ number_format($maksPlafond, 0, ',', '.') }}
@if($plafondMelebihi) Melebihi kemampuan @else Plafond layak @endif
{{-- Catatan formula --}}
RPC = 70% × (Pend. Usaha + Pend. Lain − Pengeluaran Rutin)
Maks Plafond = RPC ÷ (Bunga + 1/Tenor) = RPC ÷ ({{ $ir }}% + 1/{{ $jw }})
Plafond diajukan: Rp {{ number_format($plafondDiajukan, 0, ',', '.') }} @if($plafondMelebihi) — melebihi Maks Plafond RPC @else — dalam batas Maks Plafond RPC @endif
@endif
@endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 7: DOKUMEN --}} {{-- ═══════════════════════════════════ --}}
@if($application->documents->isEmpty())
Belum ada dokumen yang diupload.
@else
@foreach($application->documents as $doc)
@if($doc->isImage()) {{ $doc->type_label }} @else @endif
{{ $doc->type_label }}
{{ number_format($doc->file_size / 1024, 0) }} KB
Lihat
@endforeach
@endif
{{-- ═══════════════════════════════════ --}} {{-- TAB 8: ANALISIS (DA / FA / CSL) --}} {{-- ═══════════════════════════════════ --}} @if(!$application->isEditable())
{{-- SLIK --}} @if($application->hasilSlik) @php $slik = $application->hasilSlik; @endphp
Hasil SLIK / iDeb @php $riskColors = [ 'very_low' => 'bg-success', 'low' => 'bg-success', 'average' => 'bg-info text-dark', 'moderate' => 'bg-warning text-dark', 'high' => 'bg-danger', 'very_high' => 'bg-danger', ]; @endphp {{ \App\Models\HasilSlik::$RISK_OPTIONS[$slik->risk_category] ?? $slik->risk_category }}
@include('applications.partials.detail-table', ['rows' => [ 'Tanggal Query' => $slik->tanggal_query?->format('d M Y') ?? '-', 'Ada Tunggakan' => $slik->ada_tunggakan ? '⚠️ Ya' : '✓ Tidak', 'Jumlah Fasilitas Aktif' => $slik->jumlah_fasilitas_aktif ?? '-', 'Jumlah Hari Tunggakan' => $slik->jumlah_hari_tunggakan ? $slik->jumlah_hari_tunggakan . ' hari' : '-', 'Catatan' => $slik->catatan ?? '-', ]]) @if($slik->file_path) Lihat Dokumen SLIK @endif
@endif {{-- Desk Analysis --}} @if($application->verifikasiDa) @php $da = $application->verifikasiDa; @endphp
Desk Analysis (DA) {{ $da->semua_compliance_accepted ? 'Compliance' : 'Not Compliance' }}
{{-- Compliance Parameters --}} @if($da->compliance_params)
8 COMPLIANCE PARAMETER
@foreach($da->compliance_params as $param) @endforeach
{{ $param['nama'] ?? $param['label'] ?? '-' }} @if(($param['status'] ?? '') === 'accepted') Accepted @else Rejected @endif
@endif {{-- Rekomendasi DA --}} @if($da->rekomendasi_plafond_da || $da->rekomendasi_tenor_da)
@if($da->rekomendasi_plafond_da)
PLAFOND REKOMENDASI DA
Rp {{ number_format($da->rekomendasi_plafond_da, 0, ',', '.') }}
@endif @if($da->rekomendasi_tenor_da)
TENOR REKOMENDASI DA
{{ $da->rekomendasi_tenor_da }} bulan
@endif
@endif @if($da->catatan_da)
Catatan DA: {{ $da->catatan_da }}
@endif @if($da->catatan_untuk_fa)
Catatan untuk FA: {{ $da->catatan_untuk_fa }}
@endif
@endif {{-- Field Analysis --}} @if($application->verifikasiFa) @php $fa = $application->verifikasiFa; @endphp
Field Analysis (FA) @if($fa->status === 'submitted') Selesai @endif
@if($fa->item_checks)
HASIL VERIFIKASI LAPANGAN
@foreach($fa->item_checks as $item) @endforeach
Item Verifikasi Status Catatan
{{ $item['item'] ?? '-' }} @if(($item['status'] ?? '') === 'sesuai') Sesuai @else Tidak @endif {{ $item['catatan'] ?? '-' }}
@endif @if($fa->catatan_keseluruhan)
Catatan Keseluruhan: {{ $fa->catatan_keseluruhan }}
@endif @if($fa->penyesuaian_rekomendasi)
Penyesuaian Rekomendasi PL: {{ $fa->penyesuaian_rekomendasi }}
@endif {{-- Foto Lapangan --}} @if($fa->foto_lapangan)
FOTO LAPANGAN
@foreach($fa->foto_lapangan as $foto) @endforeach
@endif
@endif {{-- CSL Scoring --}} @if($application->cslScoring) @php $csl = $application->cslScoring; @endphp
Credit Scoring Level (CSL) {!! $csl->kategori_risiko_badge !!}
{{-- Skor Summary --}}
EKSTERNAL (40%)
{{ number_format($csl->skor_eksternal, 1) }}
{{ \App\Models\HasilSlik::$RISK_OPTIONS[$csl->risk_category_pefindo] ?? $csl->risk_category_pefindo ?? '-' }}
FINANCIAL (30%)
{{ number_format($csl->skor_financial, 1) }}
Rasio RPC: {{ $csl->rasio_rpc ? number_format($csl->rasio_rpc, 2) . 'x' : '-' }}
NON-FINANCIAL (30%)
{{ number_format($csl->skor_non_financial, 1) }}
10 parameter
TOTAL SKOR
{{ number_format($csl->skor_total, 1) }}
@if($csl->status_layak) Layak @else Tidak Layak @endif
{{-- Compliance --}} @if($csl->compliance_params)
COMPLIANCE PARAMETERS
{{ collect($csl->compliance_params)->where('status', 'accepted')->count() }}/8 Accepted
@foreach($csl->compliance_params as $param) @endforeach
{{ $param['nama'] ?? $param['label'] ?? '-' }} @if(($param['status'] ?? '') === 'accepted') Accepted @else Rejected @endif
@endif {{-- Non-Financial Params --}} @if($csl->params_non_financial)
PARAMETER NON-FINANCIAL
@foreach($csl->params_non_financial as $param) @endforeach
Indikator Kategori Nilai
{{ $param['nama'] ?? '-' }} {{ $param['kategori'] ?? '-' }} {{ $param['nilai'] ?? '-' }}
@endif
Dihitung pada: {{ $csl->dihitung_pada?->format('d M Y H:i') ?? '-' }}
@endif {{-- Empty state if no analysis yet --}} @if(!$application->hasilSlik && !$application->verifikasiDa && !$application->verifikasiFa && !$application->cslScoring)
Belum ada data analisis. Proses DA belum dimulai.
@endif
@endif
{{-- .tab-content --}}
{{-- .card-body --}}
{{-- .card --}}
{{-- .container-fluid --}} @push('styles') @endpush @push('scripts') @endpush @endsection