General Ledger — Jurnal Gabungan Pembelian & Penjualan

{{-- Filter Bar --}}
Dari
Sampai
Jenis
@php $data = $this->getLedgerData(); @endphp {{-- Summary Cards --}}

Total Debet

{{ number_format($data['totalDebit'], 0, ',', '.') }}

Total Kredit

{{ number_format($data['totalCredit'], 0, ',', '.') }}

Saldo Akhir

{{ number_format($data['saldoAkhir'], 0, ',', '.') }}

{{-- Ledger --}}
{{ $data['entryCount'] }} entri jurnal
{{-- Desktop Table --}}
@php $runningBalance = 0; @endphp @forelse($data['ledgerLines'] as $line) @php $runningBalance += ($line['debit'] - $line['credit']); $typeLabel = match($line['type']) { 'sales' => 'Penjualan', 'purchase' => 'Pembelian', 'payment' => 'HPP', 'receipt' => 'Penerimaan', 'adjustment' => 'Penyesuaian', default => ucfirst($line['type']) }; $typeBg = match($line['type']) { 'sales' => 'background:#D1FAE5;color:#059669;', 'purchase' => 'background:#FEF3C7;color:#D97706;', 'payment' => 'background:#DBEAFE;color:#2563EB;', 'receipt' => 'background:#FCE7F3;color:#DB2777;', 'adjustment' => 'background:#EDE9FE;color:#7C3AED;', default => 'background:#F3F4F6;color:#6B7280;' }; @endphp @empty @endforelse
Tanggal No. Ref Keterangan Jenis Debet (Rp) Kredit (Rp) Saldo (Rp)
{{ \Carbon\Carbon::parse($line['date'])->format('d M Y') }} {{ $line['reference_number'] }} {{ \Illuminate\Support\Str::limit($line['description'], 45) }} {{ $typeLabel }} {{ $line['debit'] > 0 ? number_format($line['debit'], 0, ',', '.') : '—' }} {{ $line['credit'] > 0 ? number_format($line['credit'], 0, ',', '.') : '—' }} {{ number_format($runningBalance, 0, ',', '.') }}
Belum ada entri jurnal pada periode ini
{{-- Mobile Cards --}}
@php $mobileBalance = 0; @endphp @forelse($data['ledgerLines'] as $line) @php $mobileBalance += ($line['debit'] - $line['credit']); $typeLabel = match($line['type']) { 'sales' => 'Penjualan', 'purchase' => 'Pembelian', 'payment' => 'HPP', 'receipt' => 'Penerimaan', 'adjustment' => 'Penyesuaian', default => ucfirst($line['type']) }; $typeBg = match($line['type']) { 'sales' => 'background:#D1FAE5;color:#059669;', 'purchase' => 'background:#FEF3C7;color:#D97706;', 'payment' => 'background:#DBEAFE;color:#2563EB;', 'receipt' => 'background:#FCE7F3;color:#DB2777;', 'adjustment' => 'background:#EDE9FE;color:#7C3AED;', default => 'background:#F3F4F6;color:#6B7280;' }; @endphp
{{-- Row 1: Ref + Type + Date --}}
{{ $line['reference_number'] }} {{ $typeLabel }}
{{ \Carbon\Carbon::parse($line['date'])->format('d M Y') }}
{{-- Row 2: Description --}}

{{ \Illuminate\Support\Str::limit($line['description'], 50) }}

{{-- Row 3: Debit / Credit / Saldo --}}
@if($line['debit'] > 0) D: {{ number_format($line['debit'], 0, ',', '.') }} @endif @if($line['credit'] > 0) K: {{ number_format($line['credit'], 0, ',', '.') }} @endif Saldo: {{ number_format($mobileBalance, 0, ',', '.') }}
@empty
Belum ada entri jurnal pada periode ini
@endforelse