remove pm and harry email from upload po email notification

This commit is contained in:
omair saleh
2020-11-17 12:09:33 +08:00
parent 5e99c581dd
commit fe09e76dae
+5 -5
View File
@@ -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);
});