@extends('layouts.master') @section('css') @section('title') {{ __('home.sales') }} @stop @endsection @section('content') {{-- ========================================================================= --}} {{-- 1. سكشن بيانات العميل والفرع والتواريخ --}} {{-- ========================================================================= --}}
{{ __('sales.customer') }} & {{ __('home.branches') }}
# ID
{{ __('sales.mobile_number') }}
{{ __('sales.vat_no') }}
{{ __('sales.id_number') }}
@php $userBranchId = auth()->user()->branchs_id ?? auth()->user()->branch_id; $employeeRecord = App\Models\employee::where('branch_id', $userBranchId) ->where('department', 1) ->first(); $empName = $employeeRecord ? (app()->getLocale() == 'ar' ? $employeeRecord->name_ar : $employeeRecord->name_en) : auth()->user()->name; $branchName = $employeeRecord && $employeeRecord->branch ? (app()->getLocale() == 'ar' ? ($employeeRecord->branch->name_ar ?? $employeeRecord->branch->name) : ($employeeRecord->branch->name_en ?? $employeeRecord->branch->name)) : (auth()->user()->branch->name_ar ?? auth()->user()->branch->name ?? 'طويق'); @endphp
{{ __('hr.name') }} / {{ __('home.branches') }}:
{{ __('sales.order_date') }}
{{ __('sales.delivery_date') }}
user()->roles_name ?? []) ? 'readonly' : '' }}>
{{-- ========================================================================= --}} {{-- 2. سكشن المقاسات وخيارات الخياطة --}} {{-- ========================================================================= --}}
{{ __('sales.detailed_measurements') }} & {{ __('sales.tailoring_options') }}
@php $measurements = [ __('sales.front_length') => 'front_length', __('sales.back_length') => 'back_length', __('sales.shoulder_width') => 'shoulder_width', __('sales.sleeve_length') => 'sleeve_length', __('sales.arm_width') => 'arm_width', __('sales.arm_mid_width') => 'arm_mid_width', __('sales.arm_bottom_width') => 'arm_bottom_width', __('sales.chest_width') => 'chest_width', __('sales.neck_size') => 'neck_size', __('sales.collar_size') => 'collar_size', __('sales.neck_plain') => 'neck_plain', __('sales.step_width') => 'step_width', __('sales.arm_center_width') => 'arm_center_width', __('sales.cuff_width') => 'cuff_width', __('sales.cuff_hem') => 'cuff_hem', __('sales.bottom_hem') => 'bottom_hem', __('sales.dropped_shoulder') => 'dropped_shoulder', ]; @endphp @foreach($measurements as $label => $db_field)
@endforeach @php $roles = is_array(auth()->user()->roles_name) ? auth()->user()->roles_name : json_decode(auth()->user()->roles_name, true); $isAuthorizedRole = in_array('Admin', $roles ?? []) || in_array('Manger', $roles ?? []); $branchCanEdit = auth()->user()->branch->allow_extra_edit ?? false; $canEditIncrease = $isAuthorizedRole || $branchCanEdit; @endphp
@php $notes = [ __('sales.notes_one') => 'notes_one', __('sales.notes_two') => 'notes_two', __('sales.notes_three') => 'notes_three', __('sales.notes_four') => 'notes_four', ]; @endphp @foreach($notes as $label => $db_field)
{{ $label }}
@endforeach
{{ __('sales.tailoring_options') }}
@php $groups = [ ['hand_plain', 'kabak_plain', 'hidden_pockets'], ['visible_pockets', 'janzour', 'hidden'], ['visible_hidden', 'hidden_sewing', 'twisted_sewing'] ]; $checkIndex = 1; @endphp @foreach($groups as $group)
@foreach($group as $field)
@php $checkIndex++; @endphp @endforeach
@endforeach
{{-- ========================================================================= --}} {{-- 3. سكشن الموديلات والصور --}} {{-- ========================================================================= --}}
{{ __('home.models') }}
@php $style_sections = [ 'neck' => ['title' => __('sales.neck_section'), 'folder' => 'neck', 'max' => 25], 'janzour' => ['title' => __('sales.janzour_section'), 'folder' => 'janzour', 'max' => 10], 'sleeve' => ['title' => __('sales.sleeve_section'), 'folder' => 'sleeve', 'max' => 19], 'side_p' => ['title' => __('sales.side_p_section'), 'folder' => 'side_p', 'max' => 8], 'front_p' => ['title' => __('sales.front_p_section'), 'folder' => 'front_p', 'max' => 17], ]; @endphp @foreach($style_sections as $key => $info)
{{ $info['title'] }}
{{ __('sales.style_model') }} 1
@endforeach
{{-- ========================================================================= --}} {{-- 4. سكشن شريط الإنزال وجدول الأصناف --}} {{-- ========================================================================= --}}
{{ __('sales.qty') }} {{ __('sales.unit') }} {{ __('sales.item_number') }} {{ __('sales.item_name') }} {{ __('sales.description') }} {{ __('sales.unit_price') }} {{ __('sales.totall') }} {{ __('sales.discount') }} {{ __('sales.tax') }} {{ __('sales.net_total') }}
{{-- ========================================================================= --}} {{-- 5. سكشن ملخص التفصيل (الأثواب المجهزة) --}} {{-- ========================================================================= --}}
{{ __('home.sewing_summary') }}
{{ __('home.customer') }} {{ __('home.type') }} {{ __('home.measurements') }} {{ __('home.models') }} {{ __('home.specifications') }} {{ __('home.meters') }} {{ __('home.price') }} {{ __('home.action') }}
{{-- ========================================================================= --}} {{-- 6. سكشن الحسابات والإجماليات وأزرار الإجراءات --}} {{-- ========================================================================= --}}
{{ __('sales.subtotal_before_tax_discount') }} 0.00
{{ __('sales.discount') }}
{{ __('sales.vat_amount') }} ({{ $tax_rate * 100 }}%): 0.00
{{ __('sales.final_price_inc_tax') }} 0.00
@if(auth()->user()->hasAnyRole(['Admin', 'Manger']))
@endif
{{-- ========================================================================= --}} {{-- 7. الموديلات (Modals) --}} {{-- ========================================================================= --}} @endsection @section('js') {{-- Select2 --}} @endsection