@extends('adminlte::page') @section('title', 'Realisasi Perbulan | Smart Finance') @section('content_header')

Laporan Realisasi Perbulan

Rangkuman Pendapatan & Beban dari Januari s/d Desember.

@stop @section('content')
{{-- 1. FILTER TAHUN & SEKOLAH --}}
@if(isset($daftarSekolah) && count($daftarSekolah) > 0)
@endif
{{-- 2. TABEL MATRIKS REALISASI --}}

REALISASI PENDAPATAN & BIAYA TAHUN {{ $tahun }}

@php $namaBulan = ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des']; @endphp @foreach($namaBulan as $bln) @endforeach @php $currentType = ''; $totalPerBulan = array_fill(1, 12, 0); $grandTotalYTD = 0; @endphp @forelse($realisasi as $accId => $data) {{-- Header Tipe Akun (Pendapatan / Beban) --}} @if($currentType != $data['akun']->type) @php $currentType = $data['akun']->type; @endphp @endif {{-- Baris Data Akun --}} @for($i = 1; $i <= 12; $i++) @php $nilaiBulan = $data['bulanan'][$i]; // Akumulasi total bawah (Pendapatan bertambah, Beban mengurang) if($currentType == 'REVENUE') { $totalPerBulan[$i] += $nilaiBulan; } else { $totalPerBulan[$i] -= $nilaiBulan; } @endphp @endfor {{-- Kolom Total Setahun --}} @php if($currentType == 'REVENUE') { $grandTotalYTD += $data['total_setahun']; } else { $grandTotalYTD -= $data['total_setahun']; } @endphp @empty @endforelse {{-- Baris Grand Total (Surplus/Defisit) --}} @if(count($realisasi) > 0) @for($i = 1; $i <= 12; $i++) @endfor @endif
Keterangan Akun{{ $bln }}TOTAL YTD
{{ $currentType == 'REVENUE' ? 'I. PENDAPATAN (REVENUE)' : 'II. BEBAN & BIAYA (EXPENSES)' }}
{{ $data['akun']->code }} - {{ $data['akun']->name }} {{ $nilaiBulan == 0 ? '-' : number_format($nilaiBulan, 0, ',', '.') }} {{ number_format($data['total_setahun'], 0, ',', '.') }}
Belum ada data transaksi Pendapatan/Beban di tahun ini.
SURPLUS / (DEFISIT) BERSIH {{ number_format($totalPerBulan[$i], 0, ',', '.') }} {{ number_format($grandTotalYTD, 0, ',', '.') }}
@stop @section('css') @stop @section('js') @stop