Added logic in daily task report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 9m48s
Laravel Larastan / larastan (pull_request) Failing after 11m15s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 21s
Laravel Pint / pint (pull_request) Successful in 9m48s
Laravel Larastan / larastan (pull_request) Failing after 11m15s
This commit is contained in:
@@ -56,10 +56,10 @@ class SendDailyTaskReport extends Command
|
||||
})
|
||||
->values();
|
||||
|
||||
if ($pdfFiles->isEmpty()) {
|
||||
$this->info('No PDF files found.');
|
||||
return self::SUCCESS;
|
||||
}
|
||||
// if ($pdfFiles->isEmpty()) {
|
||||
// $this->info('No PDF files found.');
|
||||
// return self::SUCCESS;
|
||||
// }
|
||||
|
||||
$parser = new Parser();
|
||||
$attachments = [];
|
||||
@@ -100,6 +100,37 @@ class SendDailyTaskReport extends Command
|
||||
$this->info('Attached: ' . basename($file));
|
||||
}
|
||||
|
||||
// Expected employees
|
||||
$expectedEmployees = [
|
||||
'Dhanabalan Saravanan',
|
||||
'Ranjith',
|
||||
'Srimathi Ramamoorthy',
|
||||
];
|
||||
|
||||
$uploadedEmployees = array_map(
|
||||
fn ($row) => strtolower(trim($row['name'])),
|
||||
$rows
|
||||
);
|
||||
|
||||
foreach ($expectedEmployees as $employeeName) {
|
||||
if (! in_array(
|
||||
strtolower(trim($employeeName)),
|
||||
$uploadedEmployees,
|
||||
true
|
||||
)) {
|
||||
$rows[] = [
|
||||
'sno' => $sno++,
|
||||
'name' => $employeeName,
|
||||
'project-name' => 'Not uploaded',
|
||||
'task' => 'PDF not received',
|
||||
'status' => 'Missing',
|
||||
'completed' => '-',
|
||||
];
|
||||
|
||||
$this->warn("PDF not uploaded by: {$employeeName}");
|
||||
}
|
||||
}
|
||||
|
||||
$toEmails = [];
|
||||
$ccEmails = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user