@extends('layouts.app') @section('content')
| Date | Particulars | Debit | Credit | Balance |
|---|---|---|---|---|
| {{ $txn->date->format('d-M-Y') }} | @if($txn->transactionable) @php $ref = $txn->transactionable; @endphp @if($ref instanceof \App\Models\Purchase) Purchase: {{ $ref->bill_no }} @elseif($ref instanceof \App\Models\Sale) Sale: {{ $ref->bill_no }} @elseif($ref instanceof \App\Models\Voucher) {{ $ref->type }}: {{ $ref->voucher_no }} @else {{ class_basename($ref) }} @endif @else Transaction @endif | {{ $txn->debit > 0 ? number_format($txn->debit, 2) : '-' }} | {{ $txn->credit > 0 ? number_format($txn->credit, 2) : '-' }} | @if($balance >= 0) {{ number_format($balance, 2) }} Dr @else {{ number_format(abs($balance), 2) }} Cr @endif |
| Closing Balance: | {{ number_format($account->transactions->sum('debit'), 2) }} | {{ number_format($account->transactions->sum('credit'), 2) }} | @if($account->closing >= 0) {{ number_format($account->closing, 2) }} Dr @else {{ number_format(abs($account->closing), 2) }} Cr @endif | |