Added invoicemail ad productionmail report views pages and commands pages

This commit is contained in:
dhanabalan
2025-07-05 20:53:31 +05:30
parent be79dcdc45
commit cfe8ac3496
8 changed files with 805 additions and 0 deletions

View 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;
}
}
}