Added logic for if record not exist no mail get trigger in send invoice data report page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 19s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 11s
Laravel Pint / pint (pull_request) Successful in 2m45s
Laravel Larastan / larastan (pull_request) Failing after 3m45s

This commit is contained in:
dhanabalan
2026-03-03 15:55:01 +05:30
parent 2b1d095437
commit 6d5184335b
2 changed files with 8 additions and 1 deletions

View File

@@ -176,7 +176,7 @@ class Scheduler extends Command
}
break;
case 'Daily':
if (now()->format('H:i') == '08:00') {
if (now()->format('H:i') == '11:30') {
\Artisan::call('send:invoice-data-report', [
'schedule_type' => $rule->schedule_type,
'plant' => $rule->plant,

View File

@@ -49,6 +49,13 @@ class SendInvoiceDataReport extends Command
return;
}
$todayRecordExists = InvoiceDataValidation::whereDate('created_at', now()->toDateString())->first();
if (!$todayRecordExists) {
$this->info('No records created today. Mail not sent.');
return;
}
// if (strtolower($scheduleType) == 'daily') {
// $startDate = now()->subDay()->setTime(10, 0, 0);//8:00
// $endDate = now()->setTime(10, 0, 0);//8