@extends('index') @section('content')

Asset Ledger: {{ $assetName }}

@if(session('success')) @endif {{-- Asset Summary --}}
Asset Name:
{{ $assetName }}
Total Acquisitions (Debit):
{{ number_format($transactions->sum('debit'), 2) }}
Total Disposals (Credit):
{{ number_format($transactions->sum('credit'), 2) }}
Net Asset Value:
{{ number_format($netValue, 2) }}
{{-- Transaction History Table --}}
@php $balance = 0; @endphp @forelse($transactions as $transaction) @php $debit = $transaction->debit ?? 0; $credit = $transaction->credit ?? 0; $balance += $debit - $credit; @endphp @empty @endforelse @if($transactions->count()) @endif
Sr. Date Transaction Type Description Debit Credit Balance Attachment Action
{{ $loop->iteration }} {{ \Carbon\Carbon::parse($transaction->transaction_date)->format('d-m-Y') ?? 'N/A' }} @if($transaction->transaction_type == 'purchase') Purchase @elseif($transaction->transaction_type == 'sale') Sale @elseif($transaction->transaction_type == 'depreciation') Depreciation @elseif($transaction->transaction_type == 'writeoff') Write-off @else Adjustment @endif {{ $transaction->description ?? '-' }} {{ $debit > 0 ? number_format($debit, 2) : '-' }} {{ $credit > 0 ? number_format($credit, 2) : '-' }} {{ number_format($balance, 2) }} @if($transaction->attachment) @else - @endif Edit
@csrf @method('DELETE')
No transactions found
Total: {{ number_format($transactions->sum('debit'), 2) }} {{ number_format($transactions->sum('credit'), 2) }} {{ number_format($netValue, 2) }}
@endsection