@extends('layouts.app') @section('title', __('role.edit_role')) @section('content')

@lang( 'role.edit_role' )

@php $pos_settings = !empty(session('business.pos_settings')) ? json_decode(session('business.pos_settings'), true) : []; @endphp @component('components.widget', ['class' => 'box-primary']) {!! Form::open(['url' => action([\App\Http\Controllers\RoleController::class, 'update'], [$role->id]), 'method' => 'PUT', 'id' => 'role_form' ]) !!}
{!! Form::label('name', __( 'user.role_name' ) . ':*') !!} {!! Form::text('name', str_replace( '#' . auth()->user()->business_id, '', $role->name) , ['class' => 'form-control', 'required', 'placeholder' => __( 'user.role_name' ) ]); !!}

@lang( 'lang_v1.others' )

@if(in_array('service_staff', $enabled_modules))
@show_tooltip(__('restaurant.tooltip_service_staff'))
@endif

@lang( 'role.user' )


@lang( 'user.roles' )


@lang( 'role.supplier' )


@lang( 'role.customer' ) @show_tooltip(__('lang_v1.customer_permissions_tooltip'))




@lang( 'business.product' )

@show_tooltip(__('lang_v1.view_purchase_price_tooltip'))

@if(in_array('purchases', $enabled_modules))

@lang( 'role.purchase' )


@endif @if(in_array('stock_adjustment', $enabled_modules))

@lang( 'role.stock_adjustment' )


@endif @if(in_array('stock_transfers', $enabled_modules))

@lang( 'role.stock_transfer' )


@endif @if(!empty($common_settings['enable_purchase_requisition']))

@lang( 'lang_v1.purchase_requisition' )


@endif @if(!empty($common_settings['enable_purchase_order']))

@lang( 'lang_v1.purchase_order' )

@endif @if(auth()->user()->can('superadmin'))

@lang( 'lang_v1.supplier_portal' )


@php $warehouse_perms = [ 'warehouse.dashboard' => __('lang_v1.warehouse_dashboard'), 'warehouse.stock' => __('lang_v1.current_stock'), 'warehouse.view_po' => __('lang_v1.received_po'), 'warehouse.update_po' => __('lang_v1.supplier_portal_update_po_status'), 'warehouse.demand' => __('lang_v1.demand_forecast'), 'warehouse.goods_qc' => __('lang_v1.goods_qc'), 'warehouse.bin_locations' => __('lang_v1.bin_locations'), 'warehouse.consignments' => __('lang_v1.consignments'), 'warehouse.cycle_count' => __('lang_v1.cycle_count'), 'warehouse.returns' => __('lang_v1.mfg_returns'), 'warehouse.rebalance' => __('lang_v1.rebalance'), 'warehouse.expiry' => __('lang_v1.expiry_alerts'), 'warehouse.cold_chain' => __('lang_v1.cold_chain'), 'warehouse.procurement_intel' => __('lang_v1.procurement_intelligence'), 'warehouse.ai_insights' => __('lang_v1.ai_insights'), ]; @endphp

@lang('lang_v1.warehouse_wms')

@foreach($warehouse_perms as $perm => $label)
@endforeach

@endif @php // Expiry & Disposal Management. Its own group rather than buried under the // "Superadmin" module heading, because four of these five are store and // warehouse operational rights, not superadmin ones. (The whole Roles // screen is superadmin-only anyway - see RoleController::__construct - // so the grouping is about finding them, not about who may set them.) // // pharmacy_expiry.view is included because it previously had NO checkbox // anywhere: saving a role therefore revoked it silently and the store // Expiry Alerts page started returning 403. $expiry_perms = [ 'pharmacy_expiry.view' => __('lang_v1.perm_pharmacy_expiry_view'), 'expiry.view' => __('lang_v1.perm_expiry_view'), 'expiry.send_to_warehouse' => __('lang_v1.perm_expiry_send'), 'expiry.receive_return' => __('lang_v1.perm_expiry_receive'), 'expiry.dispose' => __('lang_v1.perm_expiry_dispose'), 'expiry.analytics' => __('lang_v1.perm_expiry_analytics'), ]; @endphp

@lang('lang_v1.expiry_disposal')

@foreach($expiry_perms as $perm => $label)
@endforeach

@lang( 'sale.pos_sale' )

@if(in_array('pos_sale', $enabled_modules))
@endif

@lang( 'sale.sale' ) @show_tooltip(__('lang_v1.sell_permissions_tooltip'))

@if(in_array('add_sale', $enabled_modules))
@endif
@if(in_array('types_of_service', $enabled_modules))
@endif

@if(!empty($pos_settings['enable_sales_order']))

@lang( 'lang_v1.sales_order' )


@endif

@lang( 'sale.draft' )


@lang( 'lang_v1.quotation' )


@lang( 'lang_v1.shipments' )


@lang( 'cash_register.cash_register' )


@lang( 'role.brand' )


@lang( 'role.doctor' )


@lang( 'role.manufacturer' )


@lang( 'role.division' )


@lang( 'role.stock_settings' )


@lang( 'role.tax_rate' )


@lang( 'role.unit' )


@lang( 'category.category' )


@lang( 'role.report' )

@if(in_array('purchases', $enabled_modules) || in_array('add_sale', $enabled_modules) || in_array('pos_sale', $enabled_modules))
@endif
@if(in_array('expenses', $enabled_modules))
@endif

@lang( 'role.settings' )

@if(in_array('expenses', $enabled_modules))

@lang( 'lang_v1.expense' )

@endif

@lang( 'role.dashboard' )


@lang( 'account.account' )


@if(in_array('booking', $enabled_modules))

@lang( 'restaurant.bookings' )


@endif

@lang( 'lang_v1.access_selling_price_groups' )

@if(count($selling_price_groups) > 0) @foreach($selling_price_groups as $selling_price_group)
@endforeach @endif
@if(in_array('tables', $enabled_modules))

@lang( 'restaurant.restaurant' )

@endif @include('role.partials.module_permissions')
{!! Form::close() !!} @endcomponent
@endsection