@extends('layouts.app') @section('title','Statement') @push('styles') @endpush @push('scripts') {{-- Alpine.js --}} @endpush @section('content')
{{-- header bar --}}
Statement
{{-- top card (user + period + opening balance) --}}
{{ $user->name }}
{{ $user->phone ?? $user->email }}
Period
{{ $from->timezone('Asia/Dhaka')->format('d M Y') }} – {{ $to->timezone('Asia/Dhaka')->format('d M Y') }}
Opening Balance: ৳{{ number_format($openingBalance, 2) }}
{{-- DESKTOP TABLE --}} {{-- MOBILE LIST --}}
@forelse($transactions as $t) @php $createdAtDhaka = $t->created_at->timezone('Asia/Dhaka'); $meta = $t->meta; if (!is_array($meta)) { $meta = json_decode($meta ?? '[]', true) ?? []; } $ref = $meta['reference_code'] ?? ('TX-'.$t->id); $status = $meta['status'] ?? 'Success'; $truType = $meta['trx_type'] ?? ucfirst($t->type); $isCredit = $t->type === 'credit'; $oldBalance = $isCredit ? $t->balance_after - $t->amount : $t->balance_after + $t->amount; $details = $meta['details'] ?? $truType; $adminNote = $meta['admin_note'] ?? ''; $account = $user->phone ?? $user->email; $item = [ 'id' => $t->id, 'title' => $truType, 'account' => $account, 'amount' => number_format($t->amount, 2), 'balance' => number_format($t->balance_after, 2), 'old_balance' => number_format($oldBalance, 2), 'ref' => $ref, 'status' => ucfirst($status), 'type' => ucfirst($t->type), 'date' => $createdAtDhaka->format('d M Y'), 'time' => $createdAtDhaka->format('h:i A'), 'details' => $details, 'admin_note' => $adminNote, ]; @endphp
{{ $createdAtDhaka->format('d M Y') }}
{{ $createdAtDhaka->format('h:i A') }}
{{ $truType }}
{{ $isCredit ? '+' : '-' }}৳{{ number_format($t->amount, 2) }}
Bal: ৳{{ number_format($t->balance_after, 2) }}
{{ ucfirst($t->type) }}
Ref: {{ $ref }}
Status: {{ ucfirst($status) }}
PDF
@empty
এই তারিখ রেঞ্জে কোনো ট্রানজেকশন পাওয়া যায়নি।
@endforelse
{{-- 🔻 Bottom Sheet Modal (details) --}}
{{-- overlay --}}
{{-- sheet --}}
Account
Balance
Transaction ID
Old Balance
Time
Charge
৳0.00
{{-- এখানে Last Number এর জায়গায় Admin Note দেখাচ্ছি --}}
Admin Note
New Balance
Details
Status
{{-- PDF download button --}} Download PDF
@endsection