@if (isset($oneCustomer))
| Name |
: |
{{ $oneCustomer->name }} |
| Phone |
: |
{{ $oneCustomer->phone }} |
| Address |
: |
{{ $oneCustomer->address == null ? 'NULL' : $oneCustomer->address }} |
Customer Ledger
@php
$balance = 0;
@endphp
@forelse($transaction as $key => $data)
@php
$balance = $balance + $data->debit - $data->credit;
$invoice = App\Models\Invoice::where(
'customer_id',
$data->customer_id,
)->first();
// dd($invoice);
@endphp
| {{ date('Y-m-d', strtotime($data->date)) }}
|
@if ($data->transaction_type == 'Invoice')
{{ $data->transaction_type . ' (' . $data->invoice->invoice_no . ')' }}
@elseif ($data->transaction_type == 'Received from Customer')
{{ $data->transaction_type . ' (' . $data->invoice->invoice_no . ')' }}
@else
{{ $data->transaction_type }}
@endif
|
{{ $data->debit }} |
{{ $data->credit }} |
{{ $balance >= 0 ? number_format($balance, 2) : '(' . number_format(abs($balance), 2) . ')' }}
|
@empty
| No Data Found
|
@endforelse
Closing
Balance :
{{ $closeing_balance >= 0 ? number_format($closeing_balance, 2) : '(' . number_format(abs($closeing_balance), 2) . ')' }}
@else
@endif