Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development

This commit is contained in:
Dillon Ngo
2024-04-27 12:13:38 +08:00
@@ -55,10 +55,16 @@ class BulkDownloadSupplierWhiteFormsLogic
foreach($groups as $group) {
$document = $group->documents()->where('document_type', DocumentType::CURRENCY_VENDOR_ORDER)->whereNull('deleted_at')->first()->files()->first();
$created_at = $group->created_at->format('Y-m-d');
$fileContent = Storage::disk('s3')->get('documents/'.$document->file->file_info->original->file);
$zip->addFromString('invoice-' . $created_at . "_" . $group->amount . "_" . $group->reference . '.pdf', $fileContent);
Log::info('BulkDownloadSupplierWhiteFormsLogic processing: ' . 'documents/'.$document->file->file_info->original->file);
if(!Storage::disk('s3')->exists('documents/'.$document->file->file_info->original->file))
{
Log::info('BulkDownloadSupplierWhiteFormsLogic file does not exist: ' . 'documents/'.$document->file->file_info->original->file);
}
else{
$fileContent = Storage::disk('s3')->get('documents/'.$document->file->file_info->original->file);
$zip->addFromString('invoice-' . $created_at . "_" . $group->amount . "_" . $group->reference . '.pdf', $fileContent);
}
}
$zip->close();
return response()->download($zip_file);