diff --git a/Modules/User/Database/Seeders/PermissionsTableSeeder.php b/Modules/User/Database/Seeders/PermissionsTableSeeder.php
index 86870557..92ee294e 100644
--- a/Modules/User/Database/Seeders/PermissionsTableSeeder.php
+++ b/Modules/User/Database/Seeders/PermissionsTableSeeder.php
@@ -17,6 +17,8 @@ class PermissionsTableSeeder extends Seeder
public function run()
{
$permissions = [
+ //User Mangement
+ 'access_user_management',
//Products
'access_products',
'create_products',
@@ -58,6 +60,8 @@ class PermissionsTableSeeder extends Seeder
'show_sales',
'edit_sales',
'delete_sales',
+ //POS Sale
+ 'create_pos_sales',
//Sale Payments
'access_sale_payments',
//Sale Returns
@@ -76,13 +80,13 @@ class PermissionsTableSeeder extends Seeder
'delete_purchases',
//Purchase Payments
'access_purchase_payments',
- //Sale Returns
+ //Purchase Returns
'access_purchase_returns',
'create_purchase_returns',
'show_purchase_returns',
'edit_purchase_returns',
'delete_purchase_returns',
- //Sale Return Payments
+ //Purchase Return Payments
'access_purchase_return_payments',
//Currencies
'access_currencies',
@@ -104,5 +108,6 @@ class PermissionsTableSeeder extends Seeder
]);
$role->givePermissionTo($permissions);
+ $role->revokePermissionTo('access_user_management');
}
}
diff --git a/Modules/User/Resources/views/roles/edit.blade.php b/Modules/User/Resources/views/roles/edit.blade.php
index 73f17f00..33f33ce9 100644
--- a/Modules/User/Resources/views/roles/edit.blade.php
+++ b/Modules/User/Resources/views/roles/edit.blade.php
@@ -40,48 +40,33 @@
-
+
+
+
+
-
-
-
+
+
+
-
-
- hasPermissionTo('create_roles_permissions') ? 'checked' : '' }}>
-
-
-
-
-
- hasPermissionTo('edit_roles_permissions') ? 'checked' : '' }}>
-
-
-
-
@@ -89,9 +74,9 @@
-
-
-
+
+
+
@@ -145,11 +130,548 @@
+
+
+ hasPermissionTo('print_barcodes') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_adjustments') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_adjustments') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_adjustments') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_adjustments') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_adjustments') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_expenses') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_expenses') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_expenses') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_expenses') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('access_expense_categories') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_customers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_customers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_customers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_customers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_customers') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_suppliers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_suppliers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_suppliers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_suppliers') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_customers') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_pos_sales') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('access_sale_payments') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_sale_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_sale_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_sale_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_sale_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_sale_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('access_sale_return_payments') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_purchases') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_purchases') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_purchases') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_purchases') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_purchases') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('access_purchase_payments') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_purchase_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_purchase_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('show_purchase_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_purchase_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_purchase_returns') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('access_purchase_return_payments') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_currencies') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('create_currencies') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('edit_currencies') ? 'checked' : '' }}>
+
+
+
+
+
+ hasPermissionTo('delete_currencies') ? 'checked' : '' }}>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ hasPermissionTo('access_settings') ? 'checked' : '' }}>
+
+
+
+
+
+
+
@@ -159,3 +681,15 @@
@endsection
+@push('page_scripts')
+
+@endpush
diff --git a/Modules/User/Resources/views/roles/partials/permissions.blade.php b/Modules/User/Resources/views/roles/partials/permissions.blade.php
index c87c27c3..92c8970c 100644
--- a/Modules/User/Resources/views/roles/partials/permissions.blade.php
+++ b/Modules/User/Resources/views/roles/partials/permissions.blade.php
@@ -1,3 +1,4 @@
-@foreach($permissions as $permission)
+@foreach($data->getPermissionNames() as $permission)
{{ $permission }}
@endforeach
+.......
diff --git a/app/DataTables/RolesDataTable.php b/app/DataTables/RolesDataTable.php
index b2533e55..545a0557 100644
--- a/app/DataTables/RolesDataTable.php
+++ b/app/DataTables/RolesDataTable.php
@@ -20,7 +20,7 @@ class RolesDataTable extends DataTable
})
->addColumn('permissions', function ($data) {
return view('user::roles.partials.permissions', [
- 'permissions' => $data->getPermissionNames()
+ 'data' => $data
]);
});
@@ -28,7 +28,7 @@ class RolesDataTable extends DataTable
public function query(Role $model) {
return $model->newQuery()->with(['permissions' => function ($query) {
- $query->select('name')->get();
+ $query->select('name')->take(10)->get();
}])->where('name', '!=', 'Super Admin');
}
diff --git a/app/Http/Livewire/Pos/Checkout.php b/app/Http/Livewire/Pos/Checkout.php
index fe361842..418669a0 100644
--- a/app/Http/Livewire/Pos/Checkout.php
+++ b/app/Http/Livewire/Pos/Checkout.php
@@ -50,7 +50,11 @@ class Checkout extends Component
}
public function proceed() {
- $this->dispatchBrowserEvent('showCheckoutModal');
+ if ($this->customer_id != null) {
+ $this->dispatchBrowserEvent('showCheckoutModal');
+ } else {
+ session()->flash('message', 'Please Select Customer!');
+ }
}
public function calculateTotal() {