@extends('backend.layouts.master') @section('content')

User Detail

Profile Details
Company Name {{ $userDetails['company_name'] }}
Submitted Date {{ $userDetails->created_at?->format('d-m-Y h:i A') }}
Business Model @php $businessModel = $userDetails['business_model'] ?? null; $businessModelName = $businessModel; if (is_numeric($businessModel)) { $businessModelName = optional($businessCategories->firstWhere('id', (int) $businessModel))->name ?: '-'; } @endphp {{ $businessModelName ?: '-' }}
Vat Number {{ $userDetails['vat_number'] }}
Contact Person {{ $userDetails['name'] }}
Phone Number / WhatsApp {{ admin_phone($userDetails['phone_number']) }}
Email Address {{ $userDetails['email'] }}
Website @if(!empty($userDetails['website'])) {{ $userDetails['website'] }} @else - @endif
Industry Type {{ $userDetails['industry_type'] }}
Annual Spending On Uniforms {{ $userDetails['annual_spending'] }}
Country {{ $userDetails['country'] }}
City {{ $userDetails['city'] }}
Complete Address {{ $userDetails['complete_address'] }}
Discount Percentage (%) {{ $userDetails['discount_percentage'] ?? '-' }}
Max Discount Allowed {{ $userDetails['max_discount_allowed'] ?? '-' }}
{{-- --}}
Sr No. Order ID DateCompanyContact Person Phone Email Products Status Action
{{-- DISCOUNT TAB --}}
Discount Settings
@if ($userDetails->approved_at) @else @endif
{{-- Persistent Discount Alert --}}
@csrf @php $selectedCategoryId = $userDetails->business_category_id ?: (is_numeric($userDetails->business_model) ? $userDetails->business_model : null); $selectedCategory = $businessCategories->firstWhere('id', (int) $selectedCategoryId); $discountValue = $userDetails->discount_percentage ?? $selectedCategory?->discount_percentage; $maxDiscountValue = $userDetails->max_discount_allowed ?? $selectedCategory?->max_discount_allowed; @endphp @if ($businessCategories->isNotEmpty())

These values are saved for this customer only. They do not change the business category defaults.

@else

No business categories yet. Add them from Business Categories first.

@endif @if ($businessCategories->isNotEmpty() || $userDetails->business_category_id || $userDetails->discount_percentage) @endif
{{-- DISCOUNT HISTORY --}}
Discount History
@forelse($discountLogs as $index => $log) @empty @endforelse
# Business Category Discount Percentage (%) Max Discount Allowed Date & Time
{{ $index + 1 }} {{ $log->business_category ?? '-' }} {{ $log->discount_percentage !== null ? $log->discount_percentage . '%' : '-' }} {{ $log->max_discount_allowed !== null ? number_format((float) $log->max_discount_allowed, 2) : '-' }} {{ $log->created_at->format('d-m-Y h:i A') }}
No discount history available.
Which business model to choose

Use this only as a guide. If the customer selected the wrong model at signup, change it here. The discount below applies to this customer only.

Business model Who it is for How they buy
Direct Customer A company, school, hospital, hotel, or office buying uniforms for its own staff. They do not resell. Orders for their own team. Smallest discount.
Retail shop A shop that sells uniforms to walk-in customers. Buys to resell in smaller quantities. Medium discount.
Wholeseller A trader who supplies other shops or large accounts. Buys in bulk to resell. Highest discount.
Refund Credit
Available
SAR {{ number_format((float) ($userDetails->store_credit_balance ?? 0), 2) }}
Total Credited
SAR {{ number_format((float) ($storeCreditTotalCredited ?? 0), 2) }}
Total Used
SAR {{ number_format((float) ($storeCreditTotalUsed ?? 0), 2) }}
@forelse(($storeCreditTransactions ?? collect()) as $tx) @empty @endforelse
Date Type Amount Balance After Order Note
{{ $tx->created_at?->format('d-m-Y H:i') }} @if($tx->type === 'credit') Credit @else Debit @endif SAR {{ number_format((float) $tx->amount, 2) }} SAR {{ number_format((float) $tx->balance_after, 2) }} @if($tx->order_id) UF-{{ str_pad($tx->order_id, 4, '0', STR_PAD_LEFT) }} @else — @endif {{ $tx->note ?? '—' }}
No store credit transactions.
{{-- CUSTOMER PRICING TAB --}}
Customer Specific Pricing
Default Price + White Color Price Only
Note: Default Price applies to all colors except White. White Color Price is only for White color.
@foreach($products as $product) @endforeach
Product Default Price (All Colors) White Color Price Action
{{ $product->name }}
{{ $product->product_code }}
@if(!empty($customerPrices[$product->id]['default_price']) || !empty($customerPrices[$product->id]['white_price'])) @endif

Change Password

@csrf

Update Profile

@csrf

Quotation Request

@forelse ($raqList as $raq) @empty @endforelse
ID Company Name Country City Product Quantity Assigned CSR Action
QR-{{ $raq->id }} {{ $raq->company_name }} {{ $raq->country }} {{ $raq->city }} {{ $raq->product_required }} {{ $raq->quantity_required }} {{ $raq->csrDetails->name ?? '--' }} $raq->id]) }}> Detail

Sample Request

@forelse ($sampleReqList as $sraq) @empty @endforelse
ID Company Name Country City Product Assigned CSR Action
QR-{{ $sraq->id }} {{ $sraq->company_name }} {{ $sraq->country }} {{ $sraq->city }} {{ $sraq->product_required }} {{ $sraq->csrDetails->name ?? '--' }} $sraq->id]) }}> Detail
@endsection @push('scripts') @endpush