Added send invoice in transit in scheduler
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 35s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m52s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / review (pull_request) Failing after 35s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Laravel Pint / pint (pull_request) Successful in 2m18s
Laravel Larastan / larastan (pull_request) Failing after 2m52s
This commit is contained in:
@@ -183,6 +183,41 @@ class Scheduler extends Command
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$invoiceTransitRules = AlertMailRule::where('module', 'InvoiceTransit')
|
||||||
|
->where('rule_name', 'InvoiceTransitMail')
|
||||||
|
->select('plant', 'schedule_type')
|
||||||
|
->distinct()
|
||||||
|
->get();
|
||||||
|
|
||||||
|
foreach ($invoiceTransitRules as $rule) {
|
||||||
|
|
||||||
|
switch ($rule->schedule_type) {
|
||||||
|
case 'Live':
|
||||||
|
// Run every minute
|
||||||
|
\Artisan::call('send:invoice-transit-report', [
|
||||||
|
'schedule_type' => $rule->schedule_type,
|
||||||
|
'plant' => $rule->plant,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'Hourly':
|
||||||
|
if (now()->minute == 0) {
|
||||||
|
\Artisan::call('send:invoice-transit-report', [
|
||||||
|
'schedule_type' => $rule->schedule_type,
|
||||||
|
'plant' => $rule->plant,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'Daily':
|
||||||
|
if (now()->format('H:i') == '10:00') {
|
||||||
|
\Artisan::call('send:invoice-transit-report', [
|
||||||
|
'schedule_type' => $rule->schedule_type,
|
||||||
|
'plant' => $rule->plant,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user