@extends('layouts.app') @section('title', __('role.edit_role')) @section('content') @lang( 'role.edit_role' ) @component('components.widget', ['class' => 'box-primary']) {!! Form::open(['url' => action('RoleController@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' ) ]); !!} @if(in_array('service_staff', $enabled_modules)) @lang( 'lang_v1.user_type' ) {!! Form::checkbox('is_service_staff', 1, $role->is_service_staff, [ 'class' => 'input-icheck']); !!} {{ __( 'restaurant.service_staff' ) }} @show_tooltip(__('restaurant.tooltip_service_staff')) @endif @lang( 'user.permissions' ): @lang( 'role.user' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'user.view', in_array('user.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.user.view' ) }} {!! Form::checkbox('permissions[]', 'user.create', in_array('user.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.user.create' ) }} {!! Form::checkbox('permissions[]', 'user.update', in_array('user.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.user.update' ) }} {!! Form::checkbox('permissions[]', 'user.delete', in_array('user.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.user.delete' ) }} @lang( 'user.roles' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'roles.view', in_array('roles.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_role' ) }} {!! Form::checkbox('permissions[]', 'roles.create', in_array('roles.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.add_role' ) }} {!! Form::checkbox('permissions[]', 'roles.update', in_array('roles.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.edit_role' ) }} {!! Form::checkbox('permissions[]', 'roles.delete', in_array('roles.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.delete_role' ) }} @lang( 'role.supplier' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'supplier.view', in_array('supplier.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_all_supplier' ) }} {!! Form::checkbox('permissions[]', 'supplier.view_own', in_array('supplier.view_own', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_own_supplier' ) }} {!! Form::checkbox('permissions[]', 'supplier.create', in_array('supplier.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.supplier.create' ) }} {!! Form::checkbox('permissions[]', 'supplier.update', in_array('supplier.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.supplier.update' ) }} {!! Form::checkbox('permissions[]', 'supplier.delete', in_array('supplier.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.supplier.delete' ) }} @lang( 'role.customer' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'customer.view', in_array('customer.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_all_customer' ) }} {!! Form::checkbox('permissions[]', 'customer.view_own', in_array('customer.view_own', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_own_customer' ) }} {!! Form::checkbox('permissions[]', 'customer.create', in_array('customer.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.customer.create' ) }} {!! Form::checkbox('permissions[]', 'customer.update', in_array('customer.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.customer.update' ) }} {!! Form::checkbox('permissions[]', 'customer.delete', in_array('customer.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.customer.delete' ) }} @lang( 'business.product' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'product.view', in_array('product.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.product.view' ) }} {!! Form::checkbox('permissions[]', 'product.create', in_array('product.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.product.create' ) }} {!! Form::checkbox('permissions[]', 'product.update', in_array('product.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.product.update' ) }} {!! Form::checkbox('permissions[]', 'product.delete', in_array('product.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.product.delete' ) }} {!! Form::checkbox('permissions[]', 'product.opening_stock', in_array('product.opening_stock', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.add_opening_stock' ) }} {!! Form::checkbox('permissions[]', 'view_purchase_price', in_array('view_purchase_price', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.view_purchase_price') }} @show_tooltip(__('lang_v1.view_purchase_price_tooltip')) @if(in_array('purchases', $enabled_modules) || in_array('stock_adjustment', $enabled_modules) ) @lang( 'role.purchase' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'purchase.view', in_array('purchase.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.purchase.view' ) }} {!! Form::checkbox('permissions[]', 'purchase.create', in_array('purchase.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.purchase.create' ) }} {!! Form::checkbox('permissions[]', 'purchase.update', in_array('purchase.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.purchase.update' ) }} {!! Form::checkbox('permissions[]', 'purchase.delete', in_array('purchase.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.purchase.delete' ) }} {!! Form::checkbox('permissions[]', 'purchase.payments', in_array('purchase.payments', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.purchase.payments') }} @show_tooltip(__('lang_v1.purchase_payments')) {!! Form::checkbox('permissions[]', 'purchase.update_status', in_array('purchase.update_status', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.update_status') }} {!! Form::checkbox('permissions[]', 'view_own_purchase', in_array('view_own_purchase', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.view_own_purchase') }} @endif @lang( 'sale.pos_sale' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'sell.view', in_array('sell.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.sell.view' ) }} @if(in_array('pos_sale', $enabled_modules)) {!! Form::checkbox('permissions[]', 'sell.create', in_array('sell.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.sell.create' ) }} @endif {!! Form::checkbox('permissions[]', 'sell.update', in_array('sell.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.sell.update' ) }} {!! Form::checkbox('permissions[]', 'sell.delete', in_array('sell.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.sell.delete' ) }} {!! Form::checkbox('permissions[]', 'edit_product_price_from_pos_screen', in_array('edit_product_price_from_pos_screen', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.edit_product_price_from_pos_screen') }} {!! Form::checkbox('permissions[]', 'edit_product_discount_from_pos_screen', in_array('edit_product_discount_from_pos_screen', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.edit_product_discount_from_pos_screen') }} {!! Form::checkbox('permissions[]', 'print_invoice', in_array('print_invoice', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.print_invoice') }} @lang( 'sale.sale' ) {{ __( 'role.select_all' ) }} @if(in_array('add_sale', $enabled_modules)) {!! Form::checkbox('permissions[]', 'direct_sell.access', in_array('direct_sell.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.direct_sell.access' ) }} {!! Form::checkbox('permissions[]', 'direct_sell.delete', in_array('direct_sell.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.delete_sell' ) }} @endif {!! Form::checkbox('permissions[]', 'list_drafts', in_array('list_drafts', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.list_drafts' ) }} {!! Form::checkbox('permissions[]', 'list_quotations', in_array('list_quotations', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.list_quotations' ) }} {!! Form::checkbox('permissions[]', 'view_own_sell_only', in_array('view_own_sell_only', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_own_sell_only' ) }} {!! Form::checkbox('permissions[]', 'view_commission_agent_sell', in_array('view_commission_agent_sell', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_commission_agent_sell' ) }} {!! Form::checkbox('permissions[]', 'sell.payments', in_array('sell.payments', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.sell.payments') }} @show_tooltip(__('lang_v1.sell_payments')) {!! Form::checkbox('permissions[]', 'edit_product_price_from_sale_screen', in_array('edit_product_price_from_sale_screen', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.edit_product_price_from_sale_screen') }} {!! Form::checkbox('permissions[]', 'edit_product_discount_from_sale_screen', in_array('edit_product_discount_from_sale_screen', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.edit_product_discount_from_sale_screen') }} {!! Form::checkbox('permissions[]', 'discount.access', in_array('discount.access', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.discount.access') }} @if(in_array('types_of_service', $enabled_modules)) {!! Form::checkbox('permissions[]', 'access_types_of_service', in_array('access_types_of_service', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.access_types_of_service' ) }} @endif {!! Form::checkbox('permissions[]', 'access_sell_return', in_array('access_sell_return', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.access_sell_return' ) }} {!! Form::checkbox('permissions[]', 'edit_invoice_number', in_array('edit_invoice_number', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.add_edit_invoice_number' ) }} @lang( 'lang_v1.shipments' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'access_shipping', in_array('access_shipping', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.access_shipping') }} {!! Form::checkbox('permissions[]', 'access_own_shipping', in_array('access_own_shipping', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.access_own_shipping') }} {!! Form::checkbox('permissions[]', 'access_commission_agent_shipping', in_array('access_commission_agent_shipping', $role_permissions), ['class' => 'input-icheck']); !!} {{ __('lang_v1.access_commission_agent_shipping') }} @lang( 'cash_register.cash_register' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'view_cash_register', in_array('view_cash_register', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_cash_register' ) }} {!! Form::checkbox('permissions[]', 'close_cash_register', in_array('close_cash_register', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.close_cash_register' ) }} @lang( 'role.brand' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'brand.view', in_array('brand.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.brand.view' ) }} {!! Form::checkbox('permissions[]', 'brand.create', in_array('brand.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.brand.create' ) }} {!! Form::checkbox('permissions[]', 'brand.update', in_array('brand.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.brand.update' ) }} {!! Form::checkbox('permissions[]', 'brand.delete', in_array('brand.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.brand.delete' ) }} @lang( 'role.tax_rate' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'tax_rate.view', in_array('tax_rate.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.tax_rate.view' ) }} {!! Form::checkbox('permissions[]', 'tax_rate.create', in_array('tax_rate.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.tax_rate.create' ) }} {!! Form::checkbox('permissions[]', 'tax_rate.update', in_array('tax_rate.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.tax_rate.update' ) }} {!! Form::checkbox('permissions[]', 'tax_rate.delete', in_array('tax_rate.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.tax_rate.delete' ) }} @lang( 'role.unit' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'unit.view', in_array('unit.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.unit.view' ) }} {!! Form::checkbox('permissions[]', 'unit.create', in_array('unit.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.unit.create' ) }} {!! Form::checkbox('permissions[]', 'unit.update', in_array('unit.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.unit.update' ) }} {!! Form::checkbox('permissions[]', 'unit.delete', in_array('unit.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.unit.delete' ) }} @lang( 'category.category' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'category.view', in_array('category.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.category.view' ) }} {!! Form::checkbox('permissions[]', 'category.create', in_array('category.create', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.category.create' ) }} {!! Form::checkbox('permissions[]', 'category.update', in_array('category.update', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.category.update' ) }} {!! Form::checkbox('permissions[]', 'category.delete', in_array('category.delete', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.category.delete' ) }} @lang( 'role.report' ) {{ __( 'role.select_all' ) }} @if(in_array('purchases', $enabled_modules) || in_array('add_sale', $enabled_modules) || in_array('pos_sale', $enabled_modules)) {!! Form::checkbox('permissions[]', 'purchase_n_sell_report.view', in_array('purchase_n_sell_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.purchase_n_sell_report.view' ) }} @endif {!! Form::checkbox('permissions[]', 'tax_report.view', in_array('tax_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.tax_report.view' ) }} {!! Form::checkbox('permissions[]', 'contacts_report.view', in_array('contacts_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.contacts_report.view' ) }} @if(in_array('expenses', $enabled_modules)) {!! Form::checkbox('permissions[]', 'expense_report.view', in_array('expense_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.expense_report.view' ) }} @endif {!! Form::checkbox('permissions[]', 'profit_loss_report.view', in_array('profit_loss_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.profit_loss_report.view' ) }} {!! Form::checkbox('permissions[]', 'stock_report.view', in_array('stock_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.stock_report.view' ) }} {!! Form::checkbox('permissions[]', 'trending_product_report.view', in_array('trending_product_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.trending_product_report.view' ) }} {!! Form::checkbox('permissions[]', 'register_report.view', in_array('register_report.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.register_report.view' ) }} {!! Form::checkbox('permissions[]', 'sales_representative.view', in_array('sales_representative.view', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.sales_representative.view' ) }} {!! Form::checkbox('permissions[]', 'view_product_stock_value', in_array('view_product_stock_value', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.view_product_stock_value' ) }} @lang( 'role.settings' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'business_settings.access', in_array('business_settings.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.business_settings.access' ) }} {!! Form::checkbox('permissions[]', 'barcode_settings.access', in_array('barcode_settings.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.barcode_settings.access' ) }} {!! Form::checkbox('permissions[]', 'invoice_settings.access', in_array('invoice_settings.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.invoice_settings.access' ) }} @if(in_array('expenses', $enabled_modules)) {!! Form::checkbox('permissions[]', 'expense.access', in_array('expense.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.expense.access' ) }} {!! Form::checkbox('permissions[]', 'view_own_expense', in_array('view_own_expense', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.view_own_expense') }} @endif {!! Form::checkbox('permissions[]', 'access_printers', in_array('access_printers', $role_permissions),['class' => 'input-icheck']); !!} {{ __('lang_v1.access_printers') }} @lang( 'role.dashboard' ) {!! Form::checkbox('permissions[]', 'dashboard.data', in_array('dashboard.data', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'role.dashboard.data' ) }} @lang( 'account.account' ) {!! Form::checkbox('permissions[]', 'account.access', in_array('account.access', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'lang_v1.access_accounts' ) }} @if(in_array('booking', $enabled_modules)) @lang( 'restaurant.bookings' ) {{ __( 'role.select_all' ) }} {!! Form::checkbox('permissions[]', 'crud_all_bookings', in_array('crud_all_bookings', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'restaurant.add_edit_view_all_booking' ) }} {!! Form::checkbox('permissions[]', 'crud_own_bookings', in_array('crud_own_bookings', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __( 'restaurant.add_edit_view_own_booking' ) }} @endif @lang( 'lang_v1.access_selling_price_groups' ) {!! Form::checkbox('permissions[]', 'access_default_selling_price', in_array('access_default_selling_price', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __('lang_v1.default_selling_price') }} @if(count($selling_price_groups) > 0) @foreach($selling_price_groups as $selling_price_group) {!! Form::checkbox('spg_permissions[]', 'selling_price_group.' . $selling_price_group->id, in_array('selling_price_group.' . $selling_price_group->id, $role_permissions), [ 'class' => 'input-icheck']); !!} {{ $selling_price_group->name }} @endforeach @endif @if(in_array('tables', $enabled_modules)) @lang( 'restaurant.restaurant' ) {!! Form::checkbox('permissions[]', 'access_tables', in_array('access_tables', $role_permissions), [ 'class' => 'input-icheck']); !!} {{ __('lang_v1.access_tables') }} @endif @include('role.partials.module_permissions') @lang( 'messages.update' ) {!! Form::close() !!} @endcomponent @endsection