@extends('mitra.layouts.app') @section('title', 'Estimasi Keuntungan') @section('content')

Estimasi Keuntungan

Pemantauan proyeksi keuntungan per SPPG berdasarkan takaran menu dari ahli gizi. Acuan: porsi kecil Rp {{ number_format($anggaranPorsi['kecil'] ?? 8000, 0, ',', '.') }}, sedang Rp {{ number_format($anggaranPorsi['sedang'] ?? 9000, 0, ',', '.') }}, besar Rp {{ number_format($anggaranPorsi['besar'] ?? 10000, 0, ',', '.') }}.

@if($sppg)
@endif
@if(!$sppg)

Pilih SPPG untuk memantau estimasi keuntungan.

@else

Porsi Kecil

Rp {{ number_format($anggaranPorsi['kecil'] ?? 8000, 0, ',', '.') }}/porsi

Total PM: {{ number_format($penerimaByKategori['kecil'] ?? 0, 0, ',', '.') }} porsi

Porsi Sedang

Rp {{ number_format($anggaranPorsi['sedang'] ?? 9000, 0, ',', '.') }}/porsi

Total PM: {{ number_format($penerimaByKategori['sedang'] ?? 0, 0, ',', '.') }} porsi

Porsi Besar

Rp {{ number_format($anggaranPorsi['besar'] ?? 10000, 0, ',', '.') }}/porsi

Total PM: {{ number_format($penerimaByKategori['besar'] ?? 0, 0, ',', '.') }} porsi

@if($startDate && $endDate)

SPPG {{ $sppg->nama }} — {{ $startDate->translatedFormat('d M Y') }} – {{ $endDate->translatedFormat('d M Y') }}

Total Anggaran (acuan)

Rp {{ number_format($totalAnggaranPeriode, 0, ',', '.') }}

Estimasi Biaya Bahan

Rp {{ number_format($totalBiayaPeriode, 0, ',', '.') }}

Estimasi Keuntungan

Rp {{ number_format($totalEstimasiKeuntunganPeriode, 0, ',', '.') }}

@endif @if(!empty($daftarMenu))

Daftar Menu & Estimasi Keuntungan

Per menu × Penerima Manfaat (PM) = estimasi laba

@foreach($daftarMenu as $i => $m) @endforeach
No Menu Kategori PM Anggaran/porsi Biaya/porsi Total Anggaran Total Biaya Estimasi Laba
{{ $i + 1 }} {{ $m['menu'] }} {{ ucfirst($m['kategori_porsi']) }} {{ number_format($m['penerima_manfaat'], 0, ',', '.') }} Rp {{ number_format($m['anggaran_standar'], 0, ',', '.') }} Rp {{ number_format($m['biaya_per_porsi'], 0, ',', '.') }} Rp {{ number_format($m['total_anggaran'], 0, ',', '.') }} Rp {{ number_format($m['total_biaya'], 0, ',', '.') }} Rp {{ number_format($m['estimasi_keuntungan'], 0, ',', '.') }}
@endif @if($startDate && $endDate)
@foreach($dataPerTanggal as $tanggalKey => $data) @php $rows = $data['rows']; $isEmpty = empty($rows); @endphp

{{ $data['tanggal']->translatedFormat('l, d F Y') }}

@if(!$isEmpty)
Anggaran: Rp {{ number_format($data['anggaran_harian'], 0, ',', '.') }} Biaya: Rp {{ number_format($data['estimasi_biaya_from_bahan'], 0, ',', '.') }} Estimasi laba: Rp {{ number_format($data['estimasi_keuntungan_harian'], 0, ',', '.') }}
@endif
@if(!$isEmpty)

Per porsi

@foreach(['kecil' => 'Porsi Kecil', 'sedang' => 'Porsi Sedang', 'besar' => 'Porsi Besar'] as $cat => $label) @if(($data['keuntungan_per_kategori'][$cat] ?? 0) != 0) {{ $label }}: Rp {{ number_format($data['keuntungan_per_kategori'][$cat], 0, ',', '.') }} @endif @endforeach
@foreach($rows as $row) @endforeach
Menu Kategori Porsi Anggaran/porsi Biaya/porsi Total Anggaran Total Biaya Estimasi Laba
{{ $row['menu'] }} {{ ucfirst($row['kategori_porsi']) }} {{ number_format($row['jumlah_porsi'], 0, ',', '.') }} Rp {{ number_format($row['anggaran_standar'], 0, ',', '.') }} Rp {{ number_format($row['biaya_per_porsi'], 0, ',', '.') }} Rp {{ number_format($row['total_anggaran'], 0, ',', '.') }} Rp {{ number_format($row['total_biaya'], 0, ',', '.') }} Rp {{ number_format($row['estimasi_keuntungan'], 0, ',', '.') }}
@else
Tidak ada planning menu untuk hari ini.
@endif
@endforeach
@endif

Catatan: Estimasi ini dari ahli gizi berdasarkan harga pasaran & takaran menu. Keuntungan real ada di Invoice Harian (setelah vendor mencatat pembelian).

@endif @endsection