From 5ee40066198add34f0234d62c04ef1aa2b0e8e05 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Fri, 13 Nov 2020 17:49:49 +0800 Subject: [PATCH] send do with email scheduled at 8 pm everyday --- app/Console/Kernel.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 43d766de..95a4e2cb 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -37,7 +37,9 @@ class Kernel extends ConsoleKernel $approvedInvoices = InvoiceStatuses::where('status', 'approve')->whereDate('created_at', Carbon::today())->distinct()->get(['invoice_id']); $bookings = []; foreach($approvedInvoices as $approved){ - $bookings[] = $approved->invoice->booking->id; + if($approved->invoice->booking->user_id !== 1){ + $bookings[] = $approved->invoice->booking->id; + } } foreach ($bookings as $id) { $do = app(InvoiceController::class)->generateSupplierDo($id); @@ -48,7 +50,8 @@ class Kernel extends ConsoleKernel Mail::raw( "Attention to VT Admin team:\r\n\r\nKindly refer to the attachment for our DAILY DO COMPILATION ".Carbon::today()->format('d-m-Y').".\r\n\r\n**This is an automatically generated email – please do not reply to it. If you have any queries kindly contact our admin team through Wechat.\r\n\r\n\r\nCIEF WORLDWIDE SDN BHD", function($message) use ($attachment){ $message->from('exchange@cief-malaysia.com'); - $message->to(['uldvstar@gmail.com', 'pm@cief-malaysia.com', 'hasan@cief-malaysia.com', 'hasanakbar27@gmail.com', 'pmwong2019@gmail.com']); + $message->to(['vtnation16@gmail.com', 'vtnation@gmail.com', 'atvantic04@gmail.com']); + $message->cc(['shafiqa_sukeri@cief-malaysia.com', 'frontendcief@gmail.com', 'pm@cief-malaysia.com', 'hasan@cief-malaysia.com', 'shipping_admin@cief-malaysia.com']); $message->subject('CIEF DAILY DO COMPILATION '.Carbon::today()->format('d-m-Y')); $message->attach($attachment);