@extends('layouts.master') @section('css') @endsection @section('title') نسب خصم الموظفين @stop @section('page-header')
@endsection @section('content')
@if (session('success')) @endif @if ($errors->any())
@endif @php $fmtPct = fn ($v) => rtrim(rtrim(number_format((float) $v, 2, '.', ''), '0'), '.'); $customCount = $users->whereNotNull('max_discount_percent')->count(); @endphp
@csrf
أقصى نسبة خصم لكل موظف

تُطبَّق على عروض الأسعار. الحقل الفارغ يعني أن الموظف يأخذ نسبة إعدادات النظام.

نسبة النظام {{ $fmtPct($systemPercent) }}% نسبة خاصة {{ $customCount }} / {{ $users->count() }}
تطبيق نسبة على الظاهرين:
@foreach ($users as $user) @php $hasCustom = $user->max_discount_percent !== null; @endphp @endforeach
# الموظف الفرع الدور نسبة الخصم المسموح بها
{{ $loop->iteration }}
{{ mb_substr($user->name, 0, 1) }}
{{ $user->name }}
{{ $user->email }}
{{ $user->branch->name ?? '—' }} @forelse ($user->roles as $role) {{ $role->name }} @empty — @endforelse
%
{{ $hasCustom ? 'نسبة خاصة' : 'نسبة النظام' }}
التغييرات لا تُحفظ إلا بعد الضغط على زر الحفظ.
@endsection @section('js') @endsection