@extends('layouts.layoutMaster') @section('title', 'Detail Buku Besar') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/select2/select2.scss', //'resources/assets/vendor/fonts/boxicons.scss' ]) @endsection @section('page-style') @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/select2/select2.js' ]) @endsection @section('content')

Detail Buku Besar

Kembali
{{ ucfirst($account->account_type) }} {{ $account->account_code }} - {{ $account->account_name }} @if($subAccount) {{ $subAccount->sub_account_code }} - {{ $subAccount->name }} @endif @if($listSubAccount) {{ $listSubAccount->name }} @endif
Periode: {{ $startDate->format('d M Y') }} - {{ $endDate->format('d M Y') }}
Jumlah Transaksi: {{ $entries->count() }}
@php $finalBalance = $entries->last() ? $entries->last()->balance : 0; $balanceClass = $finalBalance > 0 ? 'balance-positive' : ($finalBalance < 0 ? 'balance-negative' : 'balance-neutral'); @endphp
Saldo Akhir

{{ rupiah_format(abs($finalBalance), 0, ',', '.') }}

@if(!$listSubAccount && $subAccount)
@if($subAccount->listSubAccounts->count() > 0)
@foreach($subAccount->listSubAccounts as $listSub) @php $listDebit = $listSub->debit_total ?? 0; $listCredit = $listSub->credit_total ?? 0; $listBalance = in_array($account->account_type, ['asset', 'expense']) ? $listDebit - $listCredit : $listCredit - $listDebit; $listBalanceClass = $listBalance > 0 ? 'balance-positive' : ($listBalance < 0 ? 'balance-negative' : 'balance-neutral'); @endphp @endforeach
Nama Detail Debit (Rp) Kredit (Rp) Saldo (Rp) Aksi
{{ $listSub->name }} {{ rupiah_format($listDebit, 0, ',', '.') }} {{ rupiah_format($listCredit, 0, ',', '.') }} {{ rupiah_format(abs($listBalance), 0, ',', '.') }} Detail
Total {{ rupiah_format($subAccount->debit_total, 0, ',', '.') }} {{ rupiah_format($subAccount->credit_total, 0, ',', '.') }} @php $totalBalance = in_array($account->account_type, ['asset', 'expense']) ? $subAccount->debit_total - $subAccount->credit_total : $subAccount->credit_total - $subAccount->debit_total; @endphp {{ rupiah_format(abs($totalBalance), 0, ',', '.') }}
@endif
@if($subAccount->listSubAccounts->count() > 0) @foreach($subAccount->listSubAccounts as $index => $listSub)
{{ $listSub->name }}
Lihat Detail Lengkap
@php // Get entries for this list sub account $listSubEntries = \Modules\Akuntansi\Models\JournalEntry::where('account_id', $account->id) ->where('sub_account_id', $subAccount->id) ->where('list_sub_account_id', $listSub->id) ->whereHas('journal', function ($q) use ($startDate, $endDate) { $q->whereBetween('transaction_date', [$startDate, $endDate]); }) ->with('journal') ->orderBy('created_at', 'desc') ->limit(5) ->get(); @endphp
@if($listSubEntries->count() > 0) @foreach($listSubEntries as $entry) @endforeach @else @endif
Tanggal Referensi Deskripsi Debit (Rp) Kredit (Rp)
{{ \Carbon\Carbon::parse($entry->journal->transaction_date)->format('d-m-Y') }} {{ $entry->journal->reference }} {{ $entry->journal->description }} {{ $entry->entry_type == 'debit' ? rupiah_format($entry->amount, 0, ',', '.') : '-' }} {{ $entry->entry_type == 'credit' ? rupiah_format($entry->amount, 0, ',', '.') : '-' }}
Tidak ada transaksi dalam periode ini
@if($listSubEntries->count() > 0) @endif
@endforeach @endif
@endif
Total Debit

{{ rupiah_format($entries->where('entry_type', 'debit')->sum('amount'), 0, ',', '.') }}

{{ $entries->where('entry_type', 'debit')->count() }} transaksi debit

Total Kredit

{{ rupiah_format($entries->where('entry_type', 'credit')->sum('amount'), 0, ',', '.') }}

{{ $entries->where('entry_type', 'credit')->count() }} transaksi kredit

Saldo Akhir
@php $finalBalance = $entries->last() ? $entries->last()->balance : 0; $balanceClass = $finalBalance > 0 ? 'text-success' : ($finalBalance < 0 ? 'text-danger' : 'text-muted'); @endphp

{{ rupiah_format(abs($finalBalance), 0, ',', '.') }}

Per tanggal {{ $endDate->format('d M Y') }}

Riwayat Transaksi
@php $no = 1; @endphp @foreach($entries as $entry) @php $balanceClass = $entry->balance > 0 ? 'balance-positive' : ($entry->balance < 0 ? 'balance-negative' : 'balance-neutral'); @endphp @endforeach
No Tanggal Referensi Deskripsi Debit (Rp) Kredit (Rp) Saldo (Rp)
{{ $no++ }} {{ \Carbon\Carbon::parse($entry->transaction_date)->format('d-m-Y') }} {{ $entry->reference }} {{ $entry->description }} {{ $entry->entry_type == 'debit' ? rupiah_format($entry->amount, 0, ',', '.') : '-' }} {{ $entry->entry_type == 'credit' ? rupiah_format($entry->amount, 0, ',', '.') : '-' }} {{ rupiah_format(abs($entry->balance), 0, ',', '.') }}
Total: {{ rupiah_format($entries->where('entry_type', 'debit')->sum('amount'), 0, ',', '.') }} {{ rupiah_format($entries->where('entry_type', 'credit')->sum('amount'), 0, ',', '.') }} {{ $entries->last() ? rupiah_format(abs($entries->last()->balance), 0, ',', '.') : '0' }}
@if($entries->count() > 0)
Tren Transaksi Debit dan Kredit
Perbandingan Debit vs Kredit
@endif @endsection @section('page-script') @endsection