Compare commits
2 Commits
875ea7ac2d
...
cf534af204
| Author | SHA1 | Date | |
|---|---|---|---|
| cf534af204 | |||
|
|
37d42a34de |
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Mail\InvoiceTransitMail;
|
||||
use App\Models\AlertMailRule;
|
||||
use App\Models\InvoiceInTransit;
|
||||
use App\Models\InvoiceMaster;
|
||||
use App\Models\Plant;
|
||||
use Illuminate\Console\Command;
|
||||
@@ -52,6 +53,13 @@ class SendInvoiceTransitReport extends Command
|
||||
return;
|
||||
}
|
||||
|
||||
$todayRecordExists = InvoiceInTransit::whereDate('created_at', now()->toDateString())->first();
|
||||
|
||||
if (!$todayRecordExists) {
|
||||
$this->info('No records created today. Mail not sent.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (strtolower($scheduleType) == 'daily') {
|
||||
$results = DB::table('invoice_in_transits as it')
|
||||
->join('invoice_masters as im', function ($join) {
|
||||
|
||||
Reference in New Issue
Block a user