@extends('layouts.master') @section('page_title','View Details') @section('title','Customer Details') @section('main_item','Customer') @section('sub_item','View Details') @section('content')

Customer Information

{{$customer->name}}

Address

{{$customer->landmark}}

@if ($customer->city || $customer->other_city) @if ($customer->city_id->name_en!='Other')

{{$customer->city_id->name_en}}

@else

{{$customer->other_city}}

@endif @endif @if ($customer->district_id!=0)

{{$customer->district->name_en }}

@endif

{{$customer->state}}

@if ($customer->country_id)

{{$customer->country->nicename}}

@endif

{{$customer->business_name}}

Mobile

{{$customer->mobile}}

{{$customer->mobile_2}}

{{$customer->landline}}

Sales Value

Rs {{number_format($customer->sales->sum('invoice_nettotal'),2)}}

Return Value

Rs {{number_format($sale_returns ,2)}}

Total Sale

Rs {{number_format($customer->sales->sum('invoice_nettotal')-$sale_returns,2)}}

Sale Summery

@foreach ($customer->sales->where('sale_type','order') as $sale) @endforeach
Date Invoice Waybill No Total Amount Status Action
{{explode(' ',$sale->sale_date)[0]}} #{{$sale->invoice_no}} @if ($sale->waybill_no) {{$sale->waybill_no}} @else N/A @endif {{number_format($sale->invoice_nettotal,2)}} @if ($sale->status == 'pending') Pending @elseif($sale->status == 'dispatched') Dispatched @elseif($sale->status == 'returned') Returned @else Delivered @endif

Sales Return

@foreach ($customer->salesReturns as $item) @endforeach
Return Date Reference Number Waybill No Return Reason
{{$item->return_date}} {{$item->ref_no}} {{$item->sale->waybill->waybill_no??''}} @if ($item->return_reason == 'delivery_issue') Delivery Issue @elseif ($item->return_reason == 'delivery_damage') Delivery Damage @else Other @endif
@endsection @section('scripts') @endsection