@extends('layouts.user') @section('title', __('customers.customer_ledger')) @section('content')
{{ __('customers.customer_ledger') }}
{{ $customer->name }} @if($customer->phone) ({{ $customer->phone }}) @endif
@php $currentDue = $current_due ?? (($sum_debit ?? 0) - ($sum_credit ?? 0)); @endphp {{-- SUMMARY --}}
{{ __('customers.total_debit_bills') }}
{{ number_format((float)($sum_debit ?? 0), 2) }}
{{ __('customers.total_credit_payments') }}
{{ number_format((float)($sum_credit ?? 0), 2) }}
{{ __('customers.current_due') }}
{{ number_format($currentDue, 2) }}
{{-- FILTER --}}
{{ __('customers.reset') }}
{{-- TABLE --}}
@forelse($transactions as $t) @empty @endforelse
{{ __('customers.date') }} {{ __('customers.type') }} {{ __('customers.debit') }} {{ __('customers.credit') }} {{ __('customers.bill_proof') }} {{ __('customers.note') }} {{ __('customers.action') }}
{{ optional($t->posted_at)->format('d M Y') ?? $t->created_at->format('d M Y') }}
{{ optional($t->posted_at)->format('h:i A') ?? $t->created_at->format('h:i A') }}
{{ strtoupper($t->type) }}
{{ $t->bill_no ?? $t->trx_no ?? '' }}
{{ number_format((float)$t->debit, 2) }} {{ number_format((float)$t->credit, 2) }}
@if($t->bill_photo) {{ __('customers.view_bill') }} @endif @if($t->payment_proof_photo) {{ __('customers.view_proof') }} @endif @if(!$t->bill_photo && !$t->payment_proof_photo) @endif
{{ $t->note }} {{ __('customers.edit') }}
@csrf @method('DELETE')
{{ __('customers.no_transactions_found') }}
{{ $transactions->links() }}
@endsection