@extends('layouts.app') @section('title', $customer->name) @section('content')

{{ $customer->name }} @if($customer->shop_name) ({{ $customer->shop_name }}) @endif

Receive Payment Edit Back
@if($customer->phone || $customer->address)
@if($customer->phone) Phone: {{ $customer->phone }} @endif @if($customer->address) | Address: {{ $customer->address }} @endif
@endif
Total Orders
Rs. {{ number_format($customer->orders->sum('total'), 2) }}
Total Received
Rs. {{ number_format($customer->orders->sum('paid') + $customer->payments->sum('amount'), 2) }}
Balance Due
Rs. {{ number_format($customer->balance, 2) }}
{{-- Order History --}}
Order History
@forelse($customer->orders->sortByDesc('date') as $order) @empty @endforelse
#DateItemsTotalReceived
{{ $order->id }} {{ $order->date->format('d M Y') }} @foreach($order->items as $item) {{ $item->product->category->name ?? '' }} {{ $item->product->weight->label ?? '' }} x{{ (int)$item->quantity }}{{ !$loop->last ? ', ' : '' }} @endforeach Rs. {{ number_format($order->total, 2) }} Rs. {{ number_format($order->paid, 2) }} View
No orders yet
{{-- Payment History --}}
Payment History
@forelse($customer->payments->sortByDesc('date') as $payment) @empty @endforelse
#DateAmountNotes
{{ $payment->id }} {{ $payment->date->format('d M Y') }} Rs. {{ number_format($payment->amount, 2) }} {{ $payment->notes ?: '-' }}
No payments received yet
@endsection