mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-29 17:34:02 +00:00
Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development
This commit is contained in:
+9
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user