115 lines
5.0 KiB
PHP
115 lines
5.0 KiB
PHP
@extends('layouts.app1')
|
|
|
|
@section('content')
|
|
<div class="container-fluid p-4">
|
|
<div class="card shadow-sm p-3">
|
|
<h4 class="fw-bold" style="color: #063986;">Laporan Keuangan</h4>
|
|
|
|
<!-- Form Filter Laporan -->
|
|
<form method="GET" action="{{ route('pemilik.laporan') }}" class="row g-3 mb-4">
|
|
<div class="col-md-5">
|
|
<label for="tahun" class="form-label">Pilih Tahun</label>
|
|
<select name="tahun" id="tahun" class="form-select">
|
|
@foreach ($years as $year)
|
|
<option value="{{ $year }}" {{ request()->tahun == $year ? 'selected' : '' }}>
|
|
{{ $year }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-5">
|
|
<label for="bulan" class="form-label">Pilih Bulan</label>
|
|
<select name="bulan" id="bulan" class="form-select">
|
|
<option value="">Semua Bulan</option>
|
|
@foreach ($months as $key => $month)
|
|
<option value="{{ $key }}" {{ request()->bulan == $key ? 'selected' : '' }}>
|
|
{{ $month }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="col-md-2 d-flex align-items-end">
|
|
<button type="submit" class="btn btn-primary w-100">Filter</button>
|
|
</div>
|
|
</form>
|
|
|
|
<!-- Tabel Laporan Keuangan -->
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered text-center">
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th>Tahun</th>
|
|
<th>Bulan</th>
|
|
<th>Total Pemasukan</th>
|
|
<th>Total Pengeluaran</th>
|
|
<th>Keuntungan Bersih</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($filteredLaporan as $row)
|
|
<tr>
|
|
<td>{{ $row->tahun }}</td>
|
|
<td>{{ $row->bulan }}</td>
|
|
<td>Rp {{ number_format($row->total_pemasukan, 0, ',', '.') }}</td>
|
|
<td>Rp {{ number_format($row->total_pengeluaran, 0, ',', '.') }}</td>
|
|
<td>Rp {{ number_format($row->keuntungan_bersih, 0, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Detail Pemasukan -->
|
|
<h5 class="fw-bold mt-4">Detail Pemasukan</h5>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered">
|
|
<thead class="table-success">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Tanggal</th>
|
|
<th>Deskripsi</th>
|
|
<th>Jumlah</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($detailPemasukan as $index => $pemasukan)
|
|
<tr>
|
|
<td>{{ $index + 1 }}</td>
|
|
<td>{{ $pemasukan->tanggal_pembayaran }}</td>
|
|
<td>{{ $pemasukan->status_transaksi }}</td>
|
|
<td>Rp {{ number_format($pemasukan->jumlah_pembayaran, 0, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Detail Pengeluaran -->
|
|
<h5 class="fw-bold mt-4">Detail Pengeluaran</h5>
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered">
|
|
<thead class="table-danger">
|
|
<tr>
|
|
<th>No</th>
|
|
<th>Tanggal</th>
|
|
<th>Deskripsi</th>
|
|
<th>Jumlah</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach ($detailPengeluaran as $index => $pengeluaran)
|
|
<tr>
|
|
<td>{{ $index + 1 }}</td>
|
|
<td>{{ $pengeluaran->tanggal_pengeluaran }}</td>
|
|
<td>{{ $pengeluaran->keterangan }}</td>
|
|
<td>Rp {{ number_format($pengeluaran->jumlah_pengeluaran, 0, ',', '.') }}</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
@endsection
|