@extends('layout.app') @section('_style') @php $roleGlobal = auth()->user()?:[]; @endphp @endsection @section('content')

Chi tiết khách hàng

{{ $customer->full_name }} @if($customer->account_code) {{ $customer->account_code }} @endif
{{ $customer->genderText }} @if(@$customer->status) Mối quan hệ: status->color) style="--crm-badge-color: {{$customer->status->color}}; margin-left: 5px;" @endif>{{ $customer->status->name }} @endif
{{auth()->user()->permission('phone.open') ? $customer->phone : str_limit($customer->phone, 7, 'xxx')}} @if(@$customer->branch->name) {{ $customer->branch->name }} @endif
Doanh thu tích lũy
{{number_format($customer->orders->sum('gross_revenue'))}}
Số dư ví {{number_format($customer->wallet)}}
Số tương tác
{{ $customer->groupComments->count() }}
Liên hệ cuối: {{ @diffTime($customer->last_time) ?: '—' }}
Đơn hàng
{{ $customer->orders->count() }}
Lần mua
Người phụ trách
CSKH: {{ @$customer->cskh->full_name ?: '—' }}
Mã QR
@php // Mỗi dòng: [icon, nhãn, giá trị, tông màu icon, class cho giá trị] $infoRows = [ ['fas fa-id-badge', 'Mã KH', $customer->account_code, 'primary', 'is-strong'], ['fas fa-user', 'Tên KH', $customer->full_name, 'info', 'is-strong text-info'], ['fas fa-phone-alt', 'Điện thoại', auth()->user()->permission('phone.open') ? $customer->phone : str_limit($customer->phone, 7, 'xxx'), 'success', 'is-strong'], ['fas fa-store', 'Chi nhánh', @$customer->branch->name, 'primary', ''], ['fas fa-user-tie', 'Người phụ trách', @$customer->telesale->full_name, 'info', ''], ['fas fa-headset', 'CSKH', @$customer->cskh->full_name, 'pink', ''], ['fas fa-history', 'Liên hệ cuối', @diffTime($customer->last_time), 'danger', 'text-danger'], ['fas fa-birthday-cake', 'Sinh nhật', $customer->birthday, 'pink', ''], ['fas fa-venus-mars', 'Giới tính', $customer->genderText, 'info', ''], ['fas fa-bullhorn', 'Nguồn KH', @$customer->source_customer->name, 'warning', ''], ['fas fa-user-plus', 'Người tạo', @$customer->marketing->full_name, 'success', ''], ['far fa-calendar-alt', 'Ngày tạo', $customer->created_at ? \Carbon\Carbon::parse($customer->created_at)->format('d/m/Y') : '', 'primary', ''], ['fas fa-user-friends', 'Người giới thiệu', @$customer->gioithieu->full_name, 'warning', ''], ['far fa-sticky-note', 'Mô tả', $customer->description, 'muted', ''], ]; @endphp
Thông tin khách hàng
@foreach($infoRows as [$icon, $label, $value, $tone, $valueClass])
{{ $label }} @if(trim((string) $value) !== '') {{ $value }} @else — @endif
@endforeach
Thống kê mua hàng
{{ $customer->orders->count() }}
Số đơn hàng
{{ number_format($customer->orders->sum('gross_revenue')) }}
Tổng doanh thu
0
Tương tác
@if(count($customer->historyStatus))
@include('customers._include.container_arrow')
@endif
{!! Form::open(array('url' => url('group_comments/'.request()->segment(count(request()->segments())) ), 'method' => 'post', 'files'=> true,'id'=>'fvalidate', 'class' => 'crm-composer')) !!}
{{$title}} Ctrl + Enter để gửi nhanh
{!! Form::textArea('messages', null, array('class' => 'form-control crm-composer__input', 'rows' => 3, 'placeholder' => 'Nhập nội dung trao đổi với khách hàng...')) !!}
{{-- Giữ nguyên cấu trúc plugin bootstrap-fileupload (data-provides, .btn-file, input name=image_contact) --}}
{{ Form::close() }}
@include('group_comment.ajax')
{!! Form::select('the_rest', $the_rest, null, array('class' => 'form-control','id'=>'the_rest','placeholder'=>'Tất cả đơn')) !!}
@if($roleGlobal->permission('order.add')) Tạo mới @endif
@include('order.role_type_modal')
@include('schedules.index')
{{--@if($roleGlobal->permission('tasks.index'))--}} Tạo mới {{--@endif--}}
@include('tasks.modal')
{{-- Modal thêm --}} @include('schedules.modal') {{-- END Modal thêm --}}
@if(count($wallet)) @include('wallet.history') @endif
@if(count($history)) @include('sms.history') @endif
@include('customers.modal-sendSMS')
{{--
--}} {{-- @if(count($customer_post))--}} {{-- @include('post.history')--}} {{-- @endif--}} {{--
--}}
@include('call_center.customer')
@include('albums.index')
@include('gifts.ajax')
@include('customers._include.contact')
@endsection @section('_script') {{--@include('message_fb.js_chat_app')--}} @endsection