Supplier: {{ $customer->full_name }}

Email: {{ $customer->email }}

Phone: {{ $customer->phone }}

Journals

@php $balance = 0; $totalDebit = 0; $totalCredit = 0; // Get Accounts Payable account $account_payable = App\Models\Account::where('name', 'Accounts Payable') ->where('company_id', $customer->company_id) ->first(); @endphp @foreach ($customer->journal as $j) @if ($j->debitAccount->id == $account_payable->id) @php $balance -= $j->debit; $totalDebit += $j->debit; @endphp @else @php $balance += $j->credit; $totalCredit += $j->credit; @endphp @endif @endforeach
Date Journal Number Transaction Type Account Debit Credit Balance
{{ \Carbon\Carbon::parse($j->entry_date)->format('d-m-y') }} {{ $j->entry_number }} Journal{{ $j->debitAccount->name }} {{ number_format($j->debit, 2) }} {{ $j->creditAccount->name }} {{ number_format($j->credit, 2) }}{{ number_format($balance, 2) }}
Total {{ number_format($totalDebit, 2) }} {{ number_format($totalCredit, 2) }} {{ number_format($balance, 2) }}