@extends('layouts.app') @section('title', $customer->name) @section('breadcrumb') @endsection @section('content') {{-- Stats --}}
{{ $totalSalesCount }}
Total Sales
৳{{ number_format($totalPurchased, 0) }}
Total Purchased
৳{{ number_format($totalPaid, 0) }}
Total Paid
৳{{ number_format($customer->current_due, 0) }}
Current Due
{{-- Left: Profile --}}
Profile
Name{{ $customer->name }}
Phone{{ $customer->phone ?? '—' }}
Email{{ $customer->email ?? '—' }}
Address{{ $customer->address ?? '—' }}
Opening Bal.৳{{ number_format($customer->opening_balance, 2) }}
Credit Limit{{ $customer->credit_limit > 0 ? '৳'.number_format($customer->credit_limit, 2) : 'No limit' }}
Member Since{{ $customer->created_at->format('d M Y') }}
{{-- Record Payment --}} @if($customer->current_due > 0) @can_permission('payments.customer.pay')
Record Payment
@csrf
@endcan_permission @endif
{{-- Right: History --}}
{{-- Recent Sales --}}
Recent Sales @can_permission('sales.view') All Sales @endcan_permission
@if($customer->sales->isEmpty())
No sales yet
@else @foreach($customer->sales as $sale) @endforeach
InvoiceDateTotalPaidDueStatus
{{ $sale->invoice_no }} {{ $sale->sale_date->format('d M Y') }} ৳{{ number_format($sale->total_amount, 2) }} ৳{{ number_format($sale->paid_amount, 2) }} {{ $sale->due_amount > 0 ? '৳'.number_format($sale->due_amount, 2) : '—' }} @php $sc=['completed'=>'success','hold'=>'warning','returned'=>'danger','cancelled'=>'secondary']; @endphp{{ ucfirst($sale->status) }}
@endif
{{-- Recent Payments --}}
Recent Payments
@if($customer->payments->isEmpty())
No payments yet
@else @foreach($customer->payments as $pmt) @endforeach
DateAmountMethodAccountReference
{{ $pmt->payment_date->format('d M Y') }} ৳{{ number_format($pmt->amount, 2) }} {{ ucfirst(str_replace('_',' ',$pmt->payment_method)) }} {{ $pmt->account->name }} {{ $pmt->reference ?? '—' }}
@endif
{{-- Warranties --}} @if($customer->warranties->isNotEmpty())
Warranties
@foreach($customer->warranties as $w) @endforeach
ProductSerialStartEndStatus
{{ $w->saleItem?->productVariant?->product?->name ?? '—' }} {{ $w->serialNumber?->serial_no ?? '—' }} {{ $w->start_date->format('d M Y') }} {{ $w->end_date->format('d M Y') }} {{ ucfirst($w->status) }}
@endif {{-- Repair Tickets --}} @if($customer->repairTickets->isNotEmpty())
Repair Tickets
@foreach($customer->repairTickets as $ticket) @endforeach
TicketDeviceStatusDate
{{ $ticket->ticket_no }} {{ $ticket->device_name }} {{ ucfirst(str_replace('_',' ',$ticket->status)) }} {{ $ticket->received_date->format('d M Y') }}
@endif
@endsection