Add SendInvoiceDataReport command and InvoiceDataMail class with HTML view for invoice data reporting
This commit is contained in:
@@ -12,12 +12,16 @@ Artisan::command('inspire', function () {
|
||||
// Schedule::command('send:invoice-report');
|
||||
// Schedule::command('send:production-report');
|
||||
|
||||
|
||||
|
||||
|
||||
app()->booted(function () {
|
||||
$schedule = app(Schedule::class);
|
||||
|
||||
// Production report scheduling
|
||||
//$schedule->command('report:send-daily-production')->dailyAt('07:59');
|
||||
|
||||
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
||||
//Production report scheduling
|
||||
$productionRules = AlertMailRule::where('module', 'ProductionQuantities')
|
||||
->where('rule_name', 'ProductionMail')
|
||||
->select('plant', 'schedule_type')
|
||||
->select('plant', 'schedule_type')
|
||||
@@ -67,6 +71,31 @@ Artisan::command('inspire', function () {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//Invoice Data report scheduling
|
||||
$invoiceDataRules = AlertMailRule::where('module', 'InvoiceValidation')
|
||||
->select('plant', 'schedule_type')
|
||||
->distinct()
|
||||
->get();
|
||||
|
||||
foreach ($invoiceDataRules as $rule) {
|
||||
$type = $rule->schedule_type;
|
||||
$plantId = $rule->plant;
|
||||
|
||||
$command = $schedule->command('send:invoice-data-report', [$type, $plantId]);
|
||||
|
||||
switch ($type) {
|
||||
case 'Live':
|
||||
$command->everyMinute();
|
||||
break;
|
||||
case 'Hourly':
|
||||
$command->hourly();
|
||||
break;
|
||||
case 'Daily':
|
||||
$command->dailyAt('07:59');
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user