@php
$customers = \Pramix\XCustomer\Models\CustomerModel::select(
'id',
'company_name',
'business_name',
);
$user = Auth::user();
if ($user->username != 'admin' && $user->username != 'user35'|| $user->username == 'USER30@GMAIL.COM' || $user->username == 'USER33@GMAIL.COM') {
if (Auth::user()->can(['SHOW_OWN_CUSTOMERS'])) {
$customers = $customers->where('rep_id', $user->id);
}
}
if ($user->username == 'user35'|| $user->username == 'USER30@GMAIL.COM' || $user->username == 'USER33@GMAIL.COM') {
$customers = $customers->where('invoice_type', '35');
}
$customers = $customers->get();
@endphp
{{-- {{ Form::select('customer_id', $customers, '', ['class' => 'form-control select2', 'id' => 'customer_id']) }} --}}
{{-- {{ Form::select('customer_city', \Pramix\XGeneral\Models\CityModel::pluck('name_en', 'id'), '', ['class' => 'form-control select2', 'placeholder' => 'Select City', 'id' => 'customer_city']) }} --}}
{{ Form::select('customer_district_id', \Pramix\XGeneral\Models\DistrictsModel::pluck('name_en', 'id'), '', ['class' => 'form-control select2', 'placeholder' => 'Select District', 'id' => 'customer_district_id']) }}
{{-- {{ Form::select('rep', \Pramix\XUser\Models\User::role('REPRESENTATIVE')->pluck('username', 'id'), '', ['class' => 'form-control select2', 'id' => 'rep']) }} --}}
{{-- {{ Form::select('rep', \Pramix\XUser\Models\User::role('REPRESENTATIVE')->pluck('username', 'id'), '', ['class' => 'form-control select2', 'id' => 'rep']) }} --}}