@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 }}

{{--

Business Location

@php $location_ids = App\UserHasBusinessLocation::get(); @endphp @foreach ($location_ids as $location_id) @if ($location_id->id == $customer->location_id) {{ $location_id->name }} @endif @endforeach --}}

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 Call Status 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->call_status == 'pending') Pending @elseif($sale->call_status == 'confirm') Confirm @elseif($sale->call_status == 'not_confirm') Not Confirm @elseif($sale->call_status == 'cancel') Cancel Order @elseif($sale->call_status == 'hold_oders') Hold Order @else Delivered @endif @if ($sale->call_status != 'cancel') @if ($sale->call_status == 'duplicate') Duplicate @endif @endif @if ($sale->status == 'pending') Pending @elseif($sale->status == 'dispatched') Dispatched @elseif($sale->status == 'returned') Returned @elseif ($sale->status == 'canceled') Canceled @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