MIF_E31210257/bangunan testing/resources/views/admin/app/content/detail-laba-rugi.blade.php

356 lines
16 KiB
PHP

@include('components.theme.pages.header')
<div class="row mb-4">
<div class="col-md-12">
@if(session()->has('success'))
<div class="alert alert-success mb-2">
{{ session()->get('success') }}
</div>
@else
@if(session()->has('error'))
<div class="alert alert-danger mb-2">
{{ session()->get('error') }}
</div>
@endif
@endif
<div class="card">
<div class="card-header">
<h6 class="text-primary m-0">Laba Rugi Periode {{ $periode }}</h6>
</div>
@php
$totalKredit = 0;
$totalDebit = 0;
@endphp
<div class="card-body">
<h6 class="text-primary mb-3">Kas (110)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalKas = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 1)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalKas += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Kas</td>
<td class="text-white font-weight-bold">Rp. {{ number_format($totalKas, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
<h6 class="text-primary mb-3 mt-3">Persediaan (140)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalPersediaan = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 3)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalPersediaan += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Persediaan</td>
<td class="text-white font-weight-bold">Rp.
{{ number_format($totalPersediaan, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
<h6 class="text-primary mb-3 mt-3">Pendapatan Penjualan(160)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalPendapatan = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 9)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalPendapatan += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Pendapatan</td>
<td class="text-white font-weight-bold">Rp.
{{ number_format($totalPendapatan, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
<h6 class="text-primary mb-3 mt-3">Piutang Usaha (510)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalPiutangUsaha = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 2)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalPiutangUsaha += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Piutang Usaha</td>
<td class="text-white font-weight-bold">Rp.
{{ number_format($totalPiutangUsaha, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
<h6 class="text-primary mb-3 mt-3">Hutang Usaha (510)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalHutangUsaha = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 14)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalHutangUsaha += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Hutang Usaha</td>
<td class="text-white font-weight-bold">Rp.
{{ number_format($totalHutangUsaha, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
<h6 class="text-primary mb-3 mt-3">Beban Operasional (189)</h6>
<table class="table table-striped text-center table-bordered">
<tr>
<th class="text-center">No</th>
<th class="text-center">Keterangan</th>
<th class="text-center">Debit</th>
<th class="text-center">Kredit</th>
<th class="text-center">Tanggal</th>
</tr>
@php
$no = 1;
$totalBiayaOperasional = 0;
@endphp
@foreach(\App\Models\Jurnal::where('id_akun', 15)->whereMonth('waktu_transaksi',
$bulan)->whereYear('waktu_transaksi', $tahun)->get() as $item)
@if($item->tipe === "k")
@php
$kredit = $item->nominal;
$debit = 0;
@$totalKredit += $item->nominal;
@endphp
@else
@php
$kredit = 0;
$debit = $item->nominal;
@$totalDebit += $item->nominal;
@endphp
@endif
@php
@$totalBiayaOperasional += $kredit + $debit;
@endphp
<tr>
<td class="text-center">{{ $no++ }}</td>
<td class="text-center">{{ $item['keterangan'] }}</td>
<td>Rp. {{ number_format($debit, 0, ',', '.') }},-</td>
<td>Rp. {{ number_format($kredit, 0, ',', '.') }},-</td>
<td>{{ \Carbon\Carbon::parse($item['waktu_transaksi'])->format('j F Y, H:i') }}</td>
</tr>
@endforeach
<tfoot>
<tr class="bg-dark">
<td colspan="4" class="text-white">Total Biaya Operasional</td>
<td class="text-white font-weight-bold">Rp.
{{ number_format($totalBiayaOperasional, 0, ',', '.') }}</td>
</tr>
</tfoot>
</table>
</div>
<div class="card-footer">
<div class="d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Total Pendapatan</h6>
<h6 class="m-0 ml-auto">
{{ "Rp. ".number_format($totalPendapatan, 0, ',', '.') }}
</h6>
</div>
</div>
<div class="card-footer">
<div class="d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Harga Pokok Penjualan</h6>
<h6 class="m-0 ml-auto">
{{ "Rp. ".number_format($hpp,0, ',', '.') }}
</h6>
</div>
</div>
<div class="card-footer">
<div class="d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Laba Kotor</h6>
<h6 class="m-0 ml-auto">
{{ "Rp. ".number_format($totalPendapatan - $hpp + $totalBiayaOperasional ,0, ',', '.') }}
</h6>
</div>
</div>
<div class="card-footer">
<div class="d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Beban</h6>
<h6 class="m-0 ml-auto">
{{ "Rp. ".number_format($totalBiayaOperasional ,0, ',', '.') }}
</h6>
</div>
</div>
<div class="card-footer">
<div class="d-flex align-items-center">
<h6 class="m-0 font-weight-bold text-primary">Total Laba Bersih</h6>
<h6 class="m-0 ml-auto">
{{ "Rp. ".number_format($totalPendapatan-$hpp,0, ',', '.') }}
</h6>
</div>
</div>
</div>
</div>
</div>
<!--/.row-->
@include('components.theme.pages.footer')