Compare commits
2 Commits
171c675014
...
904d850638
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
904d850638 | ||
|
|
f5e7bcb348 |
@@ -7,74 +7,138 @@ use Illuminate\Console\Scheduling\Schedule;
|
|||||||
|
|
||||||
class ScheduleList
|
class ScheduleList
|
||||||
{
|
{
|
||||||
|
// public function schedule(Schedule $schedule): void
|
||||||
|
// {
|
||||||
|
// // Invoice Report Scheduling
|
||||||
|
// $scheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
||||||
|
// ->where('rule_name', 'InvoiceMail')
|
||||||
|
// ->value('schedule_type');
|
||||||
|
|
||||||
|
// switch ($scheduleType) {
|
||||||
|
// case 'Live':
|
||||||
|
// $schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// case 'Hourly':
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// // case 'Daily':
|
||||||
|
// // $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// // break;
|
||||||
|
// case 'Daily':
|
||||||
|
// $schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// $SerialscheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
||||||
|
// ->where('rule_name', 'SerialInvoiceMail')
|
||||||
|
// ->value('schedule_type');
|
||||||
|
|
||||||
|
// switch ($SerialscheduleType) {
|
||||||
|
// case 'Live':
|
||||||
|
// $schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// case 'Hourly':
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// // case 'Daily':
|
||||||
|
// // $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// // break;
|
||||||
|
// case 'Daily':
|
||||||
|
// $schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// $materialscheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
||||||
|
// ->where('rule_name', 'MaterialInvoiceMail')
|
||||||
|
// ->value('schedule_type');
|
||||||
|
|
||||||
|
// switch ($materialscheduleType) {
|
||||||
|
// case 'Live':
|
||||||
|
// $schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// case 'Hourly':
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// // case 'Daily':
|
||||||
|
// // $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// // break;
|
||||||
|
// case 'Daily':
|
||||||
|
// $schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// $schedule->command('send:invoice-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// // Production Report Scheduling
|
||||||
|
// $productionScheduleType = AlertMailRule::where('module', 'ProductionQuantities')
|
||||||
|
// ->where('rule_name', 'ProductionMail')
|
||||||
|
// ->value('schedule_type');
|
||||||
|
|
||||||
|
// switch ($productionScheduleType) {
|
||||||
|
// case 'Live':
|
||||||
|
// $schedule->command('send:production-report')->everyMinute()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// case 'Hourly':
|
||||||
|
// $schedule->command('send:production-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// case 'Daily':
|
||||||
|
// $schedule->command('send:production-report')->dailyAt('07:59')->runInBackground();
|
||||||
|
// break;
|
||||||
|
// default:
|
||||||
|
// $schedule->command('send:production-report')->hourly()->runInBackground();
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
public function schedule(Schedule $schedule): void
|
public function schedule(Schedule $schedule): void
|
||||||
{
|
{
|
||||||
// Invoice Report Scheduling
|
// Define the rules you want to schedule
|
||||||
$scheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
$rules = [
|
||||||
->where('rule_name', 'InvoiceMail')
|
[
|
||||||
|
'module' => 'InvoiceValidation',
|
||||||
|
'rule_name' => 'InvoiceMail',
|
||||||
|
'argument' => 'InvoiceMail',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'module' => 'InvoiceValidation',
|
||||||
|
'rule_name' => 'SerialInvoiceMail',
|
||||||
|
'argument' => 'SerialInvoiceMail',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'module' => 'InvoiceValidation',
|
||||||
|
'rule_name' => 'MaterialInvoiceMail',
|
||||||
|
'argument' => 'MaterialInvoiceMail',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// Loop through each rule and schedule accordingly
|
||||||
|
foreach ($rules as $rule) {
|
||||||
|
$scheduleType = AlertMailRule::where('module', $rule['module'])
|
||||||
|
->where('rule_name', $rule['rule_name'])
|
||||||
->value('schedule_type');
|
->value('schedule_type');
|
||||||
|
|
||||||
switch ($scheduleType) {
|
switch ($scheduleType) {
|
||||||
case 'Live':
|
case 'Live':
|
||||||
$schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
$schedule->command("send:invoice-report {$rule['argument']}")->everyMinute()->runInBackground();
|
||||||
break;
|
break;
|
||||||
case 'Hourly':
|
case 'Hourly':
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
$schedule->command("send:invoice-report {$rule['argument']}")->hourly()->runInBackground();
|
||||||
break;
|
break;
|
||||||
// case 'Daily':
|
|
||||||
// $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
|
||||||
// break;
|
|
||||||
case 'Daily':
|
case 'Daily':
|
||||||
$schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
$schedule->command("send:invoice-report {$rule['argument']}")->dailyAt('07:59')->runInBackground();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
$schedule->command("send:invoice-report {$rule['argument']}")->hourly()->runInBackground();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$SerialscheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
|
||||||
->where('rule_name', 'SerialInvoiceMail')
|
|
||||||
->value('schedule_type');
|
|
||||||
|
|
||||||
switch ($SerialscheduleType) {
|
|
||||||
case 'Live':
|
|
||||||
$schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
|
||||||
break;
|
|
||||||
case 'Hourly':
|
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
|
||||||
break;
|
|
||||||
// case 'Daily':
|
|
||||||
// $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
|
||||||
// break;
|
|
||||||
case 'Daily':
|
|
||||||
$schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$materialscheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
|
||||||
->where('rule_name', 'MaterialInvoiceMail')
|
|
||||||
->value('schedule_type');
|
|
||||||
|
|
||||||
switch ($materialscheduleType) {
|
|
||||||
case 'Live':
|
|
||||||
$schedule->command('send:invoice-report')->everyMinute()->runInBackground();
|
|
||||||
break;
|
|
||||||
case 'Hourly':
|
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
|
||||||
break;
|
|
||||||
// case 'Daily':
|
|
||||||
// $schedule->command('send:invoice-report')->daily()->runInBackground(); //->dailyAt('07:59')
|
|
||||||
// break;
|
|
||||||
case 'Daily':
|
|
||||||
$schedule->command('send:invoice-report')->dailyAt('07:59')->runInBackground(); //->dailyAt('07:59')
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$schedule->command('send:invoice-report')->hourly()->runInBackground();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Production Report Scheduling
|
// Production Report Scheduling
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ class PermissionSeeder extends Seeder
|
|||||||
Permission::updateOrCreate(['name' => 'create locator validation page']);
|
Permission::updateOrCreate(['name' => 'create locator validation page']);
|
||||||
Permission::updateOrCreate(['name' => 'create pallet from locator page']);
|
Permission::updateOrCreate(['name' => 'create pallet from locator page']);
|
||||||
Permission::updateOrCreate(['name' => 'create serial locator page']);
|
Permission::updateOrCreate(['name' => 'create serial locator page']);
|
||||||
|
Permission::updateOrCreate(['name' => 'view reprint pallet number']);
|
||||||
|
|
||||||
//Dashboard Permissions
|
//Dashboard Permissions
|
||||||
Permission::updateOrCreate(['name' => 'view invoice dashboard']); //invoice dashboard
|
Permission::updateOrCreate(['name' => 'view invoice dashboard']); //invoice dashboard
|
||||||
@@ -133,5 +134,9 @@ class PermissionSeeder extends Seeder
|
|||||||
Permission::updateOrCreate(['name' => 'view guard patrol day count dashboard']);
|
Permission::updateOrCreate(['name' => 'view guard patrol day count dashboard']);
|
||||||
Permission::updateOrCreate(['name' => 'view guard patrol hourly count dashboard']);
|
Permission::updateOrCreate(['name' => 'view guard patrol hourly count dashboard']);
|
||||||
Permission::updateOrCreate(['name' => 'view invoice serial quantity dashboard']);
|
Permission::updateOrCreate(['name' => 'view invoice serial quantity dashboard']);
|
||||||
|
|
||||||
|
//Send To Sap Permissions
|
||||||
|
Permission::updateOrCreate(['name' => 'view quality data send to sap']);
|
||||||
|
Permission::updateOrCreate(['name' => 'view production data send to sap']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user