@extends('layouts.app') @section('content')

Account Ledger Report

@csrf
@isset($data)
Back Export PDF Export To Excel Crystal Report
@if(count($data) > 0)
{{ $data[0]->Account_Title }}
{{ $data[0]->DatePeriod }}
@endif
@php $balance = 0; $totalDebit = 0; $totalCredit = 0; @endphp @foreach($data as $row) @php $amount = floatval($row->Amount); $balance += $amount; if ($amount > 0) $totalDebit += $amount; if ($amount < 0) $totalCredit += abs($amount); @endphp @endforeach
Voucher Date Remarks Site Other Account Debit Credit Cl. Balance
{{ $row->Voucher ?? '' }} {{ \Carbon\Carbon::parse($row->Voucher_Date)->format('d-m-Y') }} {{ $row->Remarks }} {{ $row->Cheque_No }} {{ $row->Other_Account ?? 'N/A' }} {{ $amount > 0 ? number_format($amount, 0) : '' }} {{ $amount < 0 ? number_format(abs($amount), 0) : '' }} {{ $balance < 0 ? '(' . number_format(abs($balance), 0) . ')' : number_format($balance, 0) }}
Totals {{ number_format($totalDebit, 0) }} {{ number_format($totalCredit, 0) }} {{ $balance < 0 ? '(' . number_format(abs($balance), 0) . ')' : number_format($balance, 0) }}
@endisset
@endsection