Merge pull request 'Added process order mail alert in scheduler file' (#1456) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 29s

Reviewed-on: #1456
This commit was merged in pull request #1456.
This commit is contained in:
2026-11-17 11:44:30 +00:00

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)
$invoiceRules = AlertMailRule::where('module', 'InvoiceValidation')
->where('rule_name', 'InvoiceMail')
@@ -580,6 +616,42 @@ class Scheduler extends Command
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;
}
}
}
/**