Added invoicemail ad productionmail report views pages and commands pages
This commit is contained in:
55
app/Console/Commands/ScheduleList.php
Normal file
55
app/Console/Commands/ScheduleList.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Models\AlertMailRule;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
|
||||
class ScheduleList
|
||||
{
|
||||
public function schedule(Schedule $schedule): void
|
||||
{
|
||||
// Invoice Report Scheduling
|
||||
$scheduleType = AlertMailRule::where('module', 'InvoiceValidation')
|
||||
->where('rule_name', 'InvoiceMailAlert')
|
||||
->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;
|
||||
}
|
||||
|
||||
// Production Report Scheduling
|
||||
$productionScheduleType = AlertMailRule::where('module', 'ProductionQuantities')
|
||||
->where('rule_name', 'ProductionMailAlert')
|
||||
->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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user