@extends('layouts.app') @section('title', 'Laporan Pendapatan & Beban') @section('content')
@php $selisih = fn ($a, $b) => $b != 0 ? round(($a - $b) / abs($b) * 100, 1) : null; @endphp @foreach([ ['Total Pendapatan', $ini['total_pendapatan'], $lalu['total_pendapatan'], 'success'], ['Total Beban', $ini['total_beban'], $lalu['total_beban'], 'danger'], [$ini['laba'] >= 0 ? 'Laba Bersih' : 'Rugi Bersih', $ini['laba'], $lalu['laba'], $ini['laba'] >= 0 ? 'primary' : 'danger'], ] as [$label, $nilai, $banding, $warna])
{{ $label }} · {{ $label_ini }}
{{ rupiah($nilai) }}
@php $p = $selisih($nilai, $banding); @endphp
{{ $label_lalu }}: {{ rupiah($banding) }} @if($p !== null) {{ abs($p) }}%@endif
@endforeach
Laporan Pendapatan & Beban (Income & Expenses) {{ $judul_periode }} · dibandingkan {{ $label_lalu }}
@include('laporan._tabel-laba-rugi', ['kelas' => 'table table-sm mb-0'])
@endsection @push('styles') @include('laporan._gaya-lk') @endpush @push('scripts') @endpush