Added process order mail alert in scheduler file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 3m11s
Laravel Larastan / larastan (pull_request) Failing after 5m52s

This commit is contained in:
dhanabalan
2026-11-17 17:14:04 +05:30
parent edd858a2cd
commit 31719d79dc

View File

@@ -78,6 +78,42 @@ class Scheduler extends Command
} }
} }
//..Non plan production Report
// $nonPlanProductionRules = AlertMailRule::where('module', 'ProductionNonPlanQuantities')
// ->where('rule_name', 'NonPlanProductionMail')
// ->select('plant', 'schedule_type')
// ->distinct()
// ->get();
// foreach ($nonPlanProductionRules as $rule) {
// switch ($rule->schedule_type) {
// case 'Live':
// // Run every minute
// \Artisan::call('send:non-planned-production-report', [
// 'schedule_type' => $rule->schedule_type,
// 'plant' => $rule->plant,
// ]);
// break;
// case 'Hourly':
// if (now()->minute == 0) {
// \Artisan::call('send:non-planned-production-report', [
// 'schedule_type' => $rule->schedule_type,
// 'plant' => $rule->plant,
// ]);
// }
// break;
// case 'Daily':
// if (now()->format('H:i') == '08:00') {
// \Artisan::call('send:production-report', [
// 'schedule_type' => $rule->schedule_type,
// 'plant' => $rule->plant,
// ]);
// }
// break;
// }
// }
// --- Invoice Validation Rules --- (Invoice Mail) // --- Invoice Validation Rules --- (Invoice Mail)
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation') $invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'InvoiceMail') ->where('rule_name', 'InvoiceMail')
@@ -580,6 +616,42 @@ class Scheduler extends Command
break; break;
} }
} }
//.Process Order Report Mail
$processOrderReports = AlertMailRule::where('module', 'ProcessOrderReport')
->where('rule_name', 'ProcessOrderMail')
->select('plant', 'schedule_type')
->distinct()
->get();
foreach ($processOrderReports as $rule) {
switch ($rule->schedule_type) {
case 'Live':
// Run every minute
\Artisan::call('send:process-order-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
break;
case 'Hourly':
if (now()->minute == 0) {
\Artisan::call('send:process-order-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
case 'Daily':
if (now()->format('H:i') == '08:00') {
\Artisan::call('send:process-order-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,
]);
}
break;
}
}
} }
/** /**