Listener v1.3.0 file update and change invoice, bill show draft message
This commit is contained in:
parent
a54000932f
commit
685ccd93aa
@ -26,23 +26,6 @@ class Version130 extends Listener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$permissions = $this->getPermissions();
|
|
||||||
|
|
||||||
// Attach permission to roles
|
|
||||||
$roles = Role::all();
|
|
||||||
|
|
||||||
foreach ($roles as $role) {
|
|
||||||
$allowed = ['admin'];
|
|
||||||
|
|
||||||
if (!in_array($role->name, $allowed)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($permissions as $permission) {
|
|
||||||
$role->attachPermission($permission);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set new Item Reminder settings
|
// Set new Item Reminder settings
|
||||||
setting(['general.send_item_reminder' => '0']);
|
setting(['general.send_item_reminder' => '0']);
|
||||||
setting(['general.schedule_item_stocks' => '3,5,7']);
|
setting(['general.schedule_item_stocks' => '3,5,7']);
|
||||||
@ -60,48 +43,32 @@ class Version130 extends Listener
|
|||||||
{
|
{
|
||||||
$permissions = [];
|
$permissions = [];
|
||||||
|
|
||||||
|
// Banking Reconciliations
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'read-banking-reconciliations',
|
'name' => 'read-banking-reconciliations',
|
||||||
'display_name' => 'Read Banking Reconciliations',
|
'display_name' => 'Read Banking Reconciliations',
|
||||||
'description' => 'Read Banking Reconciliations',
|
'description' => 'Read Banking Reconciliations',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'create-banking-reconciliations',
|
'name' => 'create-banking-reconciliations',
|
||||||
'display_name' => 'Create Banking Reconciliations',
|
'display_name' => 'Create Banking Reconciliations',
|
||||||
'description' => 'Create Banking Reconciliations',
|
'description' => 'Create Banking Reconciliations',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'update-banking-reconciliations',
|
'name' => 'update-banking-reconciliations',
|
||||||
'display_name' => 'Update Banking Reconciliations',
|
'display_name' => 'Update Banking Reconciliations',
|
||||||
'description' => 'Update Banking Reconciliations',
|
'description' => 'Update Banking Reconciliations',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'delete-banking-reconciliations',
|
'name' => 'delete-banking-reconciliations',
|
||||||
'display_name' => 'Delete Banking Reconciliations',
|
'display_name' => 'Delete Banking Reconciliations',
|
||||||
'description' => 'Delete Banking Reconciliations',
|
'description' => 'Delete Banking Reconciliations',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Attach permission to roles
|
// Create Wizard Permissions
|
||||||
$roles = Role::all();
|
|
||||||
|
|
||||||
foreach ($roles as $role) {
|
|
||||||
$allowed = ['admin', 'manager'];
|
|
||||||
|
|
||||||
if (!in_array($role->name, $allowed)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($permissions as $permission) {
|
|
||||||
$role->attachPermission($permission);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getPermissions()
|
|
||||||
{
|
|
||||||
$permissions = [];
|
|
||||||
|
|
||||||
// Create permissions
|
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'create-wizard-companies',
|
'name' => 'create-wizard-companies',
|
||||||
'display_name' => 'Create Wizard Compaines',
|
'display_name' => 'Create Wizard Compaines',
|
||||||
@ -126,7 +93,7 @@ class Version130 extends Listener
|
|||||||
'description' => 'Create Wizard Finish',
|
'description' => 'Create Wizard Finish',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Read permissions
|
// Read Wizard Permissions
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'read-wizard-companies',
|
'name' => 'read-wizard-companies',
|
||||||
'display_name' => 'Read Wizard Compaines',
|
'display_name' => 'Read Wizard Compaines',
|
||||||
@ -151,7 +118,7 @@ class Version130 extends Listener
|
|||||||
'description' => 'Read Wizard Finish',
|
'description' => 'Read Wizard Finish',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Update permissions
|
// Update Wizard Permissions
|
||||||
$permissions[] = Permission::firstOrCreate([
|
$permissions[] = Permission::firstOrCreate([
|
||||||
'name' => 'update-wizard-companies',
|
'name' => 'update-wizard-companies',
|
||||||
'display_name' => 'Update Wizard Compaines',
|
'display_name' => 'Update Wizard Compaines',
|
||||||
@ -176,6 +143,19 @@ class Version130 extends Listener
|
|||||||
'description' => 'Update Wizard Finish',
|
'description' => 'Update Wizard Finish',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return $permissions;
|
// Attach permission to roles
|
||||||
|
$roles = Role::all();
|
||||||
|
|
||||||
|
foreach ($roles as $role) {
|
||||||
|
$allowed = ['admin', 'manager'];
|
||||||
|
|
||||||
|
if (!in_array($role->name, $allowed)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($permissions as $permission) {
|
||||||
|
$role->attachPermission($permission);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ return [
|
|||||||
|
|
||||||
'messages' => [
|
'messages' => [
|
||||||
'received' => 'Bill marked as received successfully!',
|
'received' => 'Bill marked as received successfully!',
|
||||||
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts once it gets receive.',
|
'draft' => 'This is a <b>DRAFT</b> bill and will be reflected to charts after it gets receive.',
|
||||||
|
|
||||||
'status' => [
|
'status' => [
|
||||||
'created' => 'Created on :date',
|
'created' => 'Created on :date',
|
||||||
|
@ -46,7 +46,7 @@ return [
|
|||||||
'email_sent' => 'Invoice email has been sent successfully!',
|
'email_sent' => 'Invoice email has been sent successfully!',
|
||||||
'marked_sent' => 'Invoice marked as sent successfully!',
|
'marked_sent' => 'Invoice marked as sent successfully!',
|
||||||
'email_required' => 'No email address for this customer!',
|
'email_required' => 'No email address for this customer!',
|
||||||
'draft' => 'This is a <b>DRAFT</b> invoice and will be reflected to charts once it gets sent.',
|
'draft' => 'This is a <b>DRAFT</b> invoice and will be reflected to charts after it gets sent.',
|
||||||
|
|
||||||
'status' => [
|
'status' => [
|
||||||
'created' => 'Created on :date',
|
'created' => 'Created on :date',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user