From fe09e76dae048fe5e02ad25e8d5cf217b3325894 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Tue, 17 Nov 2020 12:09:33 +0800 Subject: [PATCH] remove pm and harry email from upload po email notification --- app/Console/Kernel.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 95a4e2cb..e63fb3f9 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -31,10 +31,10 @@ class Kernel extends ConsoleKernel protected function schedule(Schedule $schedule) { $schedule->call(function(){ - $zipname = 'do_'.Carbon::today()->format('Y_m_d').'.zip'; + $zipname = 'do_'.Carbon::today()->subDay(1)->format('Y_m_d').'.zip'; $zip = new ZipArchive; $zip->open(storage_path('tempdir').'/'.$zipname, ZipArchive::CREATE); - $approvedInvoices = InvoiceStatuses::where('status', 'approve')->whereDate('created_at', Carbon::today())->distinct()->get(['invoice_id']); + $approvedInvoices = InvoiceStatuses::where('status', 'approve')->whereDate('created_at', Carbon::today()->subDay(1))->distinct()->get(['invoice_id']); $bookings = []; foreach($approvedInvoices as $approved){ if($approved->invoice->booking->user_id !== 1){ @@ -43,16 +43,16 @@ class Kernel extends ConsoleKernel } foreach ($bookings as $id) { $do = app(InvoiceController::class)->generateSupplierDo($id); - $zip->addFromString('do_'.Carbon::today()->format('Y_m_d').'_'.$id.'.pdf', $do->Output('do.pdf', 'S')); + $zip->addFromString('do_'.Carbon::today()->subDay(1)->format('Y_m_d').'_'.$id.'.pdf', $do->Output('do.pdf', 'S')); } $zip->close(); $attachment = storage_path('tempdir').'/'.$zipname; - 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){ + Mail::raw( "Attention to VT Admin team:\r\n\r\nKindly refer to the attachment for our DAILY DO COMPILATION ".Carbon::today()->subDay(1)->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(['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->subject('CIEF DAILY DO COMPILATION '.Carbon::today()->subDay(1)->format('d-m-Y')); $message->attach($attachment); });