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

This commit is contained in:
dhanabalan
2026-10-28 08:44:03 +05:30
parent bd3a0903f9
commit 5785196043

View File

@@ -56,10 +56,10 @@ class SendDailyTaskReport extends Command
}) })
->values(); ->values();
if ($pdfFiles->isEmpty()) { // if ($pdfFiles->isEmpty()) {
$this->info('No PDF files found.'); // $this->info('No PDF files found.');
return self::SUCCESS; // return self::SUCCESS;
} // }
$parser = new Parser(); $parser = new Parser();
$attachments = []; $attachments = [];
@@ -100,6 +100,37 @@ class SendDailyTaskReport extends Command
$this->info('Attached: ' . basename($file)); $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 = []; $toEmails = [];
$ccEmails = []; $ccEmails = [];