mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 14:04:01 +00:00
Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development
This commit is contained in:
+3
-2
@@ -70,14 +70,15 @@ class BulkDownloadCustomerInvoicesLogic
|
||||
if ($zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE)) {
|
||||
foreach ($invoicebookings as $booking) {
|
||||
$invoice_file = $booking->documents()->where('document_type', DocumentType::INVOICE)->whereNull('deleted_at')->first()->files()->first();
|
||||
$zip->addFile(Storage::disk('s3')->get('documents/'.$invoice_file->file->file_info->original->file), 'invoice-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf');
|
||||
$fileContent = Storage::disk('s3')->get('documents/'.$invoice_file->file->file_info->original->file);
|
||||
$zip->addFromString('invoice-' . $booking->created_at->format('d_m_Y') . '_' . $booking->marking . '.pdf', $fileContent);
|
||||
}
|
||||
$zip->close();
|
||||
|
||||
$filePath = 'bulk_invoice/'.$zipFileName;
|
||||
Storage::put($filePath, file_get_contents($zip_file), 's3');
|
||||
|
||||
return response(['src' => Storage::disk('s3')->get($$filePath) ]);
|
||||
return response(['src' => Storage::disk('s3')->get($filePath) ]);
|
||||
|
||||
} else {
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user