@php $no = $offset + 1; @endphp @forelse ($data as $key => $jurnal) @if ($key == 0 || ($jurnal->coa_id != $data[$key - 1]->coa_id)) @php $debit = $credit = $saldo = 0; $saldo = $jurnal->coa->saldo_awal; @endphp {{ $jurnal->coa->nama_dropdown }} ({{ $jurnal->coa->lable_type_dr_cr }}) Saldo Awal {{ formatSaldo($saldo) }} @endif @if ($jurnal->jurnalable_type != 'App\MasterCoa') {{ $no++ }} {{ date('d/m/Y', strtotime($jurnal->date)) }} {{ $jurnal->jurnalable_type_label }} {{ $jurnal->jurnalable->nomor ?? '-' }} {{ $jurnal->kodeKontak?->kode_bantu ?? '-' }} {{ $jurnal->note ?? '-' }} {{ formatNumberComma($jurnal->debit_amount) }} @php $debit += $jurnal->debit_amount; $saldo += ($jurnal->is_debit ? $jurnal->saldo : 0); @endphp {{ formatNumberComma($jurnal->credit_amount) }} @php $credit += $jurnal->credit_amount; $saldo += ($jurnal->is_credit ? $jurnal->saldo : 0); @endphp {{ formatSaldo($saldo) }} @endif @if ($key == count($data) || ($jurnal->coa_id != ($data[$key + 1]['coa_id'] ?? null))) Saldo Akhir {{ formatNumberComma($debit) }} {{ formatNumberComma($credit) }} {{ formatSaldo($saldo) }} @endif @empty Data tidak ditemukan @endforelse Grand Total {{ formatNumberComma($grandTotal['debit']) }} {{ formatNumberComma($grandTotal['credit']) }}